Remote pairing with Teletype: worth trying

Outreachy intern maudite and I tried out remote pair programming with the new Teletype plugin for Atom, and it’s really nice! At this point, it only works with Atom, and doesn’t yet support voice or video or browser sharing — we used Hangouts for that — but for the core features of working through code together, it does a really nice job.

In the future, Teletype may also allow cross-editor collaboration, so that each person can use whatever code editor (and fonts, and keybindings, etc) that they prefer.

First impressions of Ruby branch coverage with DeepCover

Branch coverage for Ruby is finally on the horizon! The built-in coverage library is expected to ship in Ruby 2.5 with branch and method coverage options.

And a pure-Ruby gem is in development, too: DeepCover.

I gave DeepCover a try with my main project, the Wiki Education Dashboard, and the coverage of the Ruby portions of the app dropped from 100% to 96.75%. Most of that is just one-line guard clauses like this:

return unless Features.wiki_ed?

But there are a few really useful things that DeepCover revealed. First off, unused scopes on Rails ActiveRecord models:

class Revision < ActiveRecord::Base
  scope :after_date, ->(date) { where('date > ?', date) }
end

Unlike default line coverage, DeepCover showed that this lambda wasn’t ever actually used. It was dead code that I removed today.

Similarly, DeepCover shows where default arguments in a method definition are never used, like this:

class Article < ActiveRecord::Base
  def update(data={}, save=true)
    self.attributes = data
    self.save if save
  end
end

This method was overriding the ActiveRecord update method, adding an option to update without saving. But we no longer use that second argument anywhere in the codebase, meaning I could delete the whole method and rely on the standard version of update.

I want a better social network

Facebook kinda sucks, and it’s not doing much to foster an informed and politically engaged citizenry. It certainly doesn’t help me to be a better citizen. Here’s what a better social network might look like.

Incentives for political engagement

Likes and comments from friends are the main drivers of both the creation of new posts and the spread of content through the newsfeed. I post things because it’s nice to feel liked and loved and to have people interested in what I have to say. Things that inspire strong emoji and pile-on comments are the most likely to earn me likes, and also the most likely to show up in my feed.

Imagine, instead, if local political engagement — showing up to a town council meeting, or calling my state legislator about a bill currently in discussion, or reporting a pothole — was the currency of your social network. I want something like the Sunlight Foundation’s tools in the middle of my online social experience. I want to see what my friends are saying, but also what they’re doing — especially when it’s something I can join in on.

Maybe streaks, like GitHub had?

Whatever the mechanisms, the things that are satisfying and addicting on a better social network should be the things that are also good for people.

Tools for collaboration

Discussions on Facebook, even when it comes to long-term issues of public importance, are ephemeral. There’s no mechanism for communities and networks to build and curate shared knowledge and context.

Local community wikis (like the handful of successful ones on localwiki.org) are still a good idea, they just lack critical mass. They would work if integrated into a better social network.

For non-local things — the quality of news sources, organizations, and everyday consumer issues — something more like aggregate reviews should be part of the system.

No ads

A big, distracting part of my Facebook feed is the ads and promoted stories. These are mostly extra-clickbait-y, ad-heavy versions of the same kinds of clickbait showing up in my feed anyway. More fundamentally, showing ads is what Facebook is designed for. Everything that is done to make it interesting and addicting and useful is ultimately an optimization for ad revenue. When one change user experience change would improve the well-being of users and another lead to 1% more ad impressions, Facebook will take the ad-driven path every time.

A better social network wouldn’t have ads.

Free software that respects privacy

Obviously, being able to get your data out and move it to another host would be a feature of an ideal social network. If the people who run it start doing things against your interests, you should have better alternatives than just signing off and deleting everything.


 

To recap: I want take Facebook, Nextdoor, Sunlight Foundation, Wikipedia, and lib.reviews, smash them all together into a great user experience and an AGPL license, and kill Facebook.

Now is the perfect time to take another shot at it. If there’s anyone working on something like this seriously, sign me up to help.

Moving forward after the election

I’ve been mulling over what happened in the election, and what I should do now.

I think these things are key:

  • Just a small difference in turnout would have turned the election around. Any conclusions about the American people that we draw based on that election would still hold true if Hillary had won. Racism, misogyny, xenophobia? They’ve been major components of our culture all along, and that would still be the case if Trump had lost.
  • Michael Moore’s explanation of why Trump would win, in retrospect, was pretty dead on. But there’s one thing I think he gets wrong: “The left has won the cultural wars.” We’re winning — with bare majorities — on some vital issues, but we haven’t won yet. Winning would mean a candidate like Trump would never have had a chance.
  • Education is one of the things that makes the biggest difference, and it’s one we can change. In recent elections, education has not been a great differentiator of voting Republican vs. Democrat. This time it was. Combine that with age and it’s even more dramatic. This is closely related to progress in the culture wars; especially in the case of younger college graduates, there’s a shared vocabulary to talk about social justice and privilege, and a conceptual framework that has become part of our everyday social and political lives rather just abstract academic jargon.

So here’s my strategy:

  • Give money now to the organizations that can help mitigate the short-term damage. The ACLU, Planned Parenthood, and independent investigative journalism are at the top of my list to fight back against abuses of power and help vulnerable people.
  • Pour my energy into things that will help in the longer term. For me, that means my day job at Wiki Education Foundation: helping professors and their students to improve Wikipedia in the areas that really matter.

If you’re a technologist, find ways to use technology to fix democracy. I’ve got some ideas — we need a better social network than Facebook, one that drives reality-based discussion and concrete political action rather than ad clicks — but I’ll save that for another post.

If you’re web developer and you want to volunteer for an open source project that makes a concrete difference in education and public knowlege, I’ve got plenty of cool things you could do for Wiki Education Foundation’s platform. It’s Ruby on Rails and React, and every day professors and college students are using it to improve coverage of important topics on Wikipedia.

Diderot — a Pebble watchface for finding nearby unillustrated Wikipedia articles

photo-nov-05-2-52-49-pmI published a watchface for Pebble smartwatches that shows you the nearest Wikipedia article that lacks a photograph. Have a Pebble and like to — or want to ­— contribute to Wikipedia? Try it out! It’s called Diderot. (Collaborators welcome!)

After using it myself for about a month and a half, I’ve finally added photographs to all the Wikipedia articles near my house within the range of Wikipedia’s ‘nearby’ API.

Extra thanks go to Albin Larrson, who built the WMF Labs API that my app uses to find nearby unillustrated articles. The great thing about it is that it filters out articles that have .png or .svg images, so you still find the articles that have only a map or logo rather than a real photograph.

Rails migrations and Capistrano don’t mix

Last night I learned the hard way what happens when Rails migrations break.

My main project, the Wiki Ed Dashboard, is set up for automatic deployment — via Capistrano and travis-ci— whenever we push new commits to the staging or production branch. It’s mostly nice.

But I ran some migrations yesterday that I shouldn’t have. In particular, this one added three new columns to a table. When I pushed it to staging, the migration took about 5 minutes and then finished. Since the staging app was unresponsive during that time, I waited until the evening to deploy it to production. But things went much worse on production, which has a somewhat large database. The migration took more than 10 minutes — at which point, travis-ci decides that the build has become unresponsive, and kills it. The migration didn’t complete.

No problem, I thought, I’ll just run the migration again. Nope! It tursn out that the first column from that migration actually made it into the MySQL database. Running it again triggered a duplicate column error. Hmmm… okay. Maybe all the columns got added, but the migration didn’t get added to the database? So I manually added the migration id to the schema_migrations table. Alas, no. Things are still broken, because the other two columns didn’t actually get added.

That’s why Rails migrations have an up and a down version, right? I’ll just migrate that one down and back up. But with only one of three columns present, neither the up nor the down migration would run. I ended up writing an ad-hoc migration to add just the second and third columns, deploying it from my own machine, and then deleting the migration afterwards. I fixed production, but it wasn’t pretty.

My takeaway from this: if you deploy via Capistrano — and especially if you deploy straight from your continuous integration server — then write a separate migration for every little thing. When things go bad in the middle of deployment, you don’t want to be stuck with a half-completed migration.

(among the) best programming podcasts

Since I started both running semi-regularly and also biking 30+minutes on the Burke a couple times per week, I’ve started listening to a lot of podcasts — mainly focusing on technology (especially free software, web development, and Ruby) and product management. I’ve listening to enough good, and enough bad, that I want to share some of the podcasts I’ve found most interesting and helpful.

Weekly podcasts

These are the most consistently good, consistently released ones I listen to. Not every episode is great, but they are worthwhile enough of the time that I usually at least sample a bit of each new episode.

  • Ruby Rogues – a great panel, featuring the awesome Coraline Ada Ehmke, among others. It’s excellent both for Rubyists specifically and as a general software discussion venue.
  • Talk Python To Me – a superb interview-based podcast. The focus is Python, but it’s very accessible even without a deep knowledge of the specific language, and I often get ideas from it that are relevant for my work. Episodes usually start with a lot of personal narrative about how the interviewee got to where they are, which is often really interesting.
  • CodePen Radio – this one is focused on the startup codepen.io, and is usually a fun listen. The range of topics — all drawn from running a web app-based startup — maps pretty nicely onto the things that are relevant for me, running the technology side of a small nonprofit. (I’ve still never used CodePen, and don’t feel like I need to in order to get value from the podcast.)
  • The Changelog – the best of the handful of free / open source software podcasts, this one is interview based, usually goes deeply into the background of each guest, and has consistently interesting guests.
  • Javascript Jabber – the javascript companion to Ruby Rogues, this one is a little more scattered and less consistently insightful, but still has a pretty high ratio of solid episodes.
  • Ruby5 – this short podcast comes out twice per week, and basically runs down interesting news and new releases in the Ruby and Rails worlds. It’s a little cheesy, but it’s worth your time if you work with Ruby or Rails.

Individual episodes

These are some of the podcast episodes that I recommend. Some come from the podcasts above, and others are individual episodes from podcasts that I otherwise don’t listen to regularly or wouldn’t recommend highly.

  • The Changelog: The Future of WordPress and Calypso with Matt Mullenweg – I wish I could just hang out all the time with Matt Mullenweg.
  • Data Skeptic: Wikipedia Revision Scoring as a Service – This interview with Aaron Halfaker is the best overview of Wikipedia’s editor trends that I’ve seen/heard.
  • Javascript Jabber: The Evolution of Flux Libraries – This late-2015 overview of React, Flux and Redux is the best of many React-related podcasts I’ve listened it. It helped clarify my thinking a lot.
  • Ruby Rogues: Neo4j – a nice Ruby-centered introduction to the concept of graph databases
  • Javascript Jabber: npm 3 – an interesting overview of the npm roadmap, which helped me understand a lot more about what npm does and what it’s trying to do
  • Ruby Rogues: Feature Toggles – a discussion of feature toggles as an key enabler of a trunk-based development git strategy
  • Ruby Rogues: The Crystal Programming Language – with the creator of Crystal, made me eager to start using Crystal
  • Ruby Rogues: The Leprechauns of Software Engineering – with the author of the book of the same title, super interesting

 

Hello from 2016

It’s been more than a year since I’ve blogged. Sigh.

It’s been a good year. I learned Ruby, and I’ve become fluent enough that it’s really fun. I even wrote my first Twitter bot.

I started running, and have done enough of it that isn’t pure torture.

It looks like we’re staying in Seattle for good — we bought a house, and there’s a guest room for folks passing through — and I love it here. Work is fun, the kids are fun (if exasperating), and more and more family is nearby. The Wikipedia and free culture communities around here are great.

Lot’s more I’d like to write about — stories to tell, pictures to post — but Brighton keeps asking me to play, and I can’t put him off any longer. I think my modest goal will be for this not to be the only post in 2016.

Screencasting on Debian: Kazam is good!

I’ve periodically done screencasting and screen recording over the last few years — mostly while running Ubuntu or Debian — and it’s been an evolving pain to find a piece of GNU/Linux screen recording software that actually works. The one I’ve had the most success with is gtk-RecordMyDesktop, but it’s confusing to configure, and can be quite picky with audio sources… sometimes making it impossible to capture audio at all. There are other alternatives — byzanz, istanbul — that tend to be just as buggy or worse.

My current use case is slightly complicated: I’m doing Google Hangouts sessions with people using the web app I’ve been working on, and I want to record the video of them using it, their audio, and my audio. Basically, I want to record my user testing sessions — so far, without success, at least for audio.

The one promising project the last time I tried was Kazam, but it was still too buggy for me to use successfully.  It looks like it’s in pretty good shape now… it lets me choose the window to record, and I can add audio from both sound from speakers and microphone, with human-readable pulldowns for which speaker device and which microphone device, and it worked successfully to record a Hangout. And, it has nice file format options (including VP8/webm, which is the best option for uploading to Wikimedia Commons).

Nice work, Kazam developers!