My favorite things: Plantronics BackBeat FIT

There are a ton of Bluetooth headphone options out there, but for some reason none of them work that well for me. Most are earbud-style and they always fall out of my ears (maybe that’s just how earbuds are). My previous Bluetooth headphones of choice were another pair of Plantronics headphones, the venerable PLT-BB903+ (just rolls right off the tongue, I know), but they weren’t looking very good this side of the year 2010. 
The BackBeat Fit is like a modernized reinvention of the old BackBeat headphones. This is what they look like:
You can imagine the squeal I made when I saw this was the color they came in. Hats off to Plantronics for doing such spot-on market research!
They come in blue, too. I own a pair of these as well and these are my desk pair.
The design of these headphones is fantastic. The most important distinction between these Bluetooth headphones and most others is that these aren’t earbuds, nor are they trying to be. They hook over your ear.
That makes an incredible difference. They won’t fall out of your ears because your ears themselves are propping them up. That makes these headphones I can actually go out and do stuff with because I don’t have to worry they’ll fall out.
Another great thing about them not being earbuds is that they don’t try to seal off your eardrums. They just rest comfortably in your ear and you can still hear your surroundings, and they sound clear, not muffled, as they do when you wear normal earbuds and get them to make a seal. They’re a very safe choice if you’re going to be doing things like crossing streets while listening to a podcast. For added safety, the headsets are colored with reflective paint.
Bluetooth reception and battery life are great on these too. These can easily get me through a full workday on one charge, and I can keep my phone in whichever pocket I want without the sound cutting out. 
I have a lot of headphones but these are probably the ones I spend the most hours listening to things on. 
I can also attest to Plantronics’s great warranty service (but save your original receipt in Evernote or something!). My initial pair of these headphones spontaneously quit on me one day, and Plantronics was quick to the draw with a replacement pair, overnighting it to me before I even mailed the old ones back. No emailing back and forth was needed, no phone call, just a quick filling out of their web form. I’m not thrilled they died spontaneously like that, but I have to tip my hat to Plantronics for taking care of it so fast.

My favorite things: Sugru

I’ve recently introduced myself to Sugru (pronounced “sue grew”) and I’m really finding myself enamored with it.
Unlike the other products I post on here, Sugru has no particular use in and of itself. Sugru is simple; it’s just a silicone-based substance that feels a little like Play-Doh and in 24 hours will cure in whatever shape you’ve left it in.
It has some interesting properties. It bonds to a lot of surfaces very effectively. It is waterproof. It’s (somewhat) heat-proof. And you can remove it from a surface if you no longer need it.
This makes it a great tool for repairing things. Got a cable that’s fraying? Put Sugru on it! Want to prevent your iPhone cables from fraying? Put a Sugru grip around the part that is most vulnerable to stress! 
I really like the mindset that Sugru puts you into. It really takes the hacker mindset that is engrained in people who love to hack software things, and with a very simple product it opens up the ability for you to hack physical objects in a lot of ways. It gives you the ability to 3D print your own objects in a rudimentary way; it’s simply silicone modeling clay!
I strongly recommend that you just go and order yourself some on Amazon (or pick some up at Radio Shack before they go bankrupt; they happen to carry it!). Put it in the fridge (it keeps 3x longer that way) and save it for the next time you find that you have a need for it. It’s only a matter of time before you find a great use for some.

Thoughts and Speculation about the 12″ MacBook Air

The leaked specs and artist’s rendering of Apple’s alleged 12″ MacBook Air are a radical move for Apple laptops, particularly in that they are getting rid of most of the ports in favor of just two: a USB Type C connector, and a headphone jack.

Coincidentally, the iPad and iPhones have just a headphone jack and a power/peripheral connector.
Trying to strip down an OS X device even further to make it have incredible portability feels like a challenging move. I’m wondering if this fabled device might not be a miniaturization of a desktop Mac laptop, but instead, a more productivity-driven version of the iPad.
Here are some thoughts that led me to think that:
  • Chromebooks are quietly growing in popularity, especially with schools and other places where people just want a radically simple device to use. An iOS device that is more laptop-like is a lot more full-featured of a device than a laptop-like device that can only be a web browser.
  • To get desktop Macs to the next level of portability you have to strip out features to reduce the device’s size. You have to make the processors more power efficient and possibly weaker to get that battery life.
  • iPads don’t need to be stripped; they are very powerful and have great battery life.
  • A more laptop-like iPad is less portable; it’s very easy for Apple to achieve a device like that than making a MacBook approach iPad levels of battery life.
  • Apple’s been doing an increasing amount with making iOS more conducive to productivity
    • the switch from specific sizes to “size classes” for apps so that iOS apps can run on a variety of device sizes. This will likely lead to a mode this year for having many apps on screen at once. At the very least, it’s evidence that Apple wants to be able to experiment with a variety of device sizes without making developers do a redesign every time.
    • extensions let apps talk to each other with greater ease
    • The iPad Air 2 is more desktop-class than ever before. It’s a powerful machine that can be used for just about anyone’s everyday computing needs.
  • Right now iPads are as little as a few hundred dollars. Apple could command a premium for a laptop version of an iPad and have more comfortable margins, as opposed to trying to reduce the price of a Mac and compress their margins more.
  • I struggle to see Apple releasing a new, non-Retina device in 2015. If this were a MacBook Air, I struggle to see how they can get Retina resolution in such a tiny, fanless design. But if this were an iPad, that’s a no-brainer.
  • Though an older, more stubborn Apple would never have added a physical keyboard to an iOS device, the new Apple is more willing to try things it previously snubbed.
  • The leaks talked only about hardware. Nothing explicitly said it’d run OS X.
  • The number of Macs Apple’s selling is growing. iPad sales are plateauing. Apple could be aiming to grow iPad sales by making an iPad that looks like a Mac. A lot of customers could probably buy an iPad as their main computer but are anxious about the fact that it’s so different-looking.
This is purely speculation and I could be totally off on this and there is some evidence of that:
  • It’s absolutely precedented for Apple to keep pushing laptops to get thinner and smaller and have more battery life.
    • This 12″ Air feels about as radical as the original Air felt when it first was released in 2008 in terms of the fact that it loses all those ports (people felt a little anxious about losing the optical drive!)
  • The leaked 12″ Air had a trackpad, and it was specifically mentioned as not having a clicker on it (possibly in favor of taptic feedback). Would Apple really add a mouse cursor to iOS? That would surprise me.
    • A trackpad doesn’t mean that Apple’s adding a cursor, though. It could just mean that Apple’s adding a way to pan and scroll without reaching up. Time will tell.
  • The new laptop design is coinciding with the availability of new chips from Intel that are making this possible. Apple wouldn’t use Intel chips in an iOS device.
    • Granted, the new Intel chip could just be a coincidence.
  • Using an iOS device’s multitouch in a laptop mode is a little awkward.
    • Then again, that could be why the trackpad’s coming.
  • The keyboard in the rendering had function keys. An iOS device wouldn’t really need those, and if it had one, therre wouldn’t be any F1, F2, etc. labels
    • But it’s important to note that those photos are renderings and not actual photos of real hardware. 
Although I can throw together enough evidence and ideas to make a case that this new device could be iOS-enabled, it could just be wishful thinking on my part. Although a 12″ MacBook Air running OS X is certainly a leap forward and interesting, making an iOS device with that same form factor is super interesting. 

The fucking news

I finally finished the last episodes of The Newsroom recently, and it got me thinking and worrying about the future of journalism. I know a lot of old guard organizations that did great work are dying a slow death into irrelevance, and that’s sad. I see hope in a lot of new organizations popping up doing great journalism in a digital age (Vice and Salon come to mind), but I can’t help but feel like we’re still seeing a net loss. Although new tools make the barrier to getting into doing journalism a lot smaller, we are losing the quality of journalism that comes from great big organizations with a lot of resources to do great news for us. 
But man, for an industry that needs all the money it can get, I am amazed at the sheer awfulness of the news products these companies are putting out. The experience is so user-hostile.
  • I don’t want to have to visit your web site and check the news from there every day; I want to aggregate it.
  • I don’t want to need to use your mobile app to read the news.
  • I don’t want your article pages to be magazine-like with painstaking layouts and typography. Good writing suits me just fine. If you do want do do those things, keep the design clean.
  • I don’t want my news pages littered with ads. In fact, I don’t want any ads at all.
  • I don’t want articles cluttered with links to other things I “might be interested in,” half of which are actually ads posing as real content, and many of which have carefully constructed clickbait titles. And i sure as hell don’t want these links inserted into the article content.
  • I don’t want to make comments on your site or participate in any sort of community with the other readers, and the only people who seem to aren’t exactly generating positive discourse.
  • I don’t want the articles I’m reading to be paginated. I know how to scroll.
  • I don’t want a toolbar at the bottom with a call to action for me to share that thing to a bunch of social networks. If I want to share the article, I know how to copy a link.
  • I don’t want to pay over $100/year to support the site. News companies are pricing these as though I get all my news from one source, when I’m reading from dozens of sources in a given week.
  • I don’t want to see user generated content on my news site. There are other sites where I look at user generated content, like Twitter, or Instagram, or Vine, or YouTube, or Facebook, or one of the dozens of other places.
  • I don’t want to read articles that managed somehow to extract four paragraphs of filler from a single tweet. I’d rather just look at the tweet.
  • I don’t want my news site to have a social presence, trying to push things to me to read there.
  • I don’t want my news site to be incentivized to get me to click on their articles.
  • I don’t want a video at the top of the articles I’m reading, and I sure as hell don’t want it to auto-play.
I want:
  • Well-written articles that are rigorously fact-checked and well contextualized
    • Bonus points if you happened to capture some photos of the event. If you didn’t, that’s okay, you don’t need to show me a stock photo of something related to it.
  • A full-article RSS feed that lets me do all my reading from my RSS reader.
  • A way to easily pay you a fair price for the above two things, and ensure that you’re beholden to me, and not your parent company, not advertisers, not some bullshit KPIs somebody wants you to hit. 
  • the ability to share links to nice clean versions of articles with my friends and followers
  • The news org to be independent from corporate owners. If I’m paying you, I want you working for me.
  • For news like this to be available to me at the local, regional, national, and international levels (and I don’t mind paying separately for each)
In short, I want to read the fucking news.
Sometimes i like to listen to the news, and I think podcasts (which, like Dan Benjamin, I like to just refer to as internet radio) are the future of audio news updates. I also like weekly shows like Last Week Tonight (which admittedly pushes the limits of being able to call itself a legitimate news show but they’re doing good work). And I’m willing to pay more for podcasts and video formatted news shows. But ultimately the core experience I demand as a news consumer is to read the news. 
That’s really all I want. I’m happy to pay something like $50 a year from multiple organizations for news like this. And this format doesn’t have to be just for news news. I would love to see The Onion offer something like this (especially The Onion; their sponsored content is getting obnoxious). Ars Technica Premier offers something very much like this. 
Being able to pay $50 a year for news is a privilege, though, and I agree that those who can’t spend that kind of money should still have access to the news. I can’t name a specific model for non-paying users that would be successful. Maybe free users would see tasteful, non-obtrusive banner ads (though I really hate the idea of a reader’s eyeballs being treated as currency), and the free RSS feed would not have full articles. 
Maybe I’m just an old geezer who is still clinging onto RSS, but it truly is the best tool for those who want to keep up with news from many sources. RSS respects you as a reader. It puts you in control of what you see. It doesn’t let you be tracked with cookies. It is super flexible. 

The “I’m guilty of this too” trope

You’ve all gotten that email or spoken message from a boss, preaching to the team about how everyone needs to break some bad habit.

And then they say it.

“I know it’s tough. I’m guilty of this too, but we all need to come together and stop doing this.”

Can we agree this trope needs to die? Managers will say that almost like it’s a reflex, feeling like it gives them relatability or credibility. And I’m sure that the first time in history a manager employed this rhetorical device it did do just that. Nowadays it’s meaningless. It feels like a component from a criticism template, like when you sandwich a criticism between two compliments (another trope I hate with a passion).

Perhaps the biggest issue with it is that it comes off as “I know I have this flaw too, yet I’m the one telling you to change your behavior.” 

There are better ways to be relatable. If you want to come off as a strong leader, don’t say “You guys need to stop doing this thing. I’m guilty of doing this too.” Say “I’m guilty of doing this thing, and I understand why it’s harmful, and I’m going to stop.” Get people to hold you accountable and follow your lead.

When things go wrong in Apple-land

In a previous post i discussed a way Apple could tweak its development process to make its software products more reliable. But even if Apple can achieve a product that fails 0.0001% of the time, that’s still a pretty large absolute number of failures at Apple’s scale. And what’s worse, now that Apple’s products need to have a lot of systems working perfectly together in order to work, when something is going wrong, Apple’s support staff are now woefully unable to solve the problem.

If I walk into the Genius Bar with something straightforward like a dead power supply, I’m walking out a satisfied customer. But if I’m walking in with a sufficiently complex problem, or a problem that is intermittent, or a problem that in some way touches a third party system, then it’s a frustrating road ahead of me.

When iPods first became a thing, a common way to diagnose them was to just do a factory reset and see if the problem persisted after that. It wasn’t a big deal, and since the iPod was an appliance of sorts, this was a reasonable approach. But I’m commonly hearing Geniuses ask me to do the same thing to my Mac now when they encounter a problem they don’t understand that well. The Mac is a full-on desktop computer; if you have a specific issue with it, that is an expensive and overkill way to try to diagnose the problem, and even if a reformat does fix the problem, you at best are just saying “okay, I know it’s not the hardware.” Oh, and now I have to spend the next two weeks getting everything configured the way I like it. Whoopee. Apple still commonly uses this approach with iPhones too, which isn’t as bad of an issue with Macs, but restoring an iPhone from backup is still a multi-hour process and given that you’re just restoring an exact copy of its configuration from before, when you restore you typically restore the problem too.

Even worse are the inane troubleshooting steps Apple staff now try to walk you through just to make it seem like they’re trying something. You of course have your classic Mac troubleshooting steps like resetting the PRAM and SMC, but now that issues can sometimes involve things like iCloud, I’m hearing other silly-sounding solutions that scream that Apple’s support staff are grasping at straws for some sense of being able to dig into a problem. Calling through your iPhone isn’t working? Well, restart your wireless router of course! Yeah, I’ll just have my IT guy reboot my office wireless access points because that’s Apple’s best guess.

And I’m not blaming Apple support staff for not being helpful. These are the limited tools they have at their disposal to try to hope something works. This isn’t good enough with the level of complexity Apple’s systems have, though. 

As Apple is developing these new features they need to be also developing powerful diagnostic tools their support people can use to zero in on exactly where the problem is. If the Call With iPhone feature is failing when I try to receive a phone call on my Mac, there should be a way for a genius to dig into the problem on my Mac and my iPhone to see where the breakdown is happening. If I’m having iMessages issues, a Genius should be able to crack open logging data for my account (bonus points if there’s no way to do it without my explicit permission) and look at logs (with all my actual message content still encrypted and/or redacted, of course).

Another thing I’d really love to see is better visibility into my backups. There’s no excuse in 2015 for iCloud not to be able to show me detailed contents of my backup, and let me pick what I want to restore (and while I’m making reasonable requests, show me actual details about the progress of my restore, like what it’s currently restoring and what it needs to do still)

Having tools like this in place can help prevent that feeling of helplessness when a magical Apple system isn’t behaving so magically for you.

On The Bravery Of Trans People

Recently I’ve been thinking  a lot about Leelah Alcorn’s death. But this post isn’t really about Leelah. It’s more about the people who slog through the life that would have been too painful for Leelah to bear.
Being gay I can relate to trans people in that we’re both somewhat outsiders, but I am really lucky in that I am living through a shift in public opinion on gay people in the US. But trans people are not gaining support that quickly. In some cases trans people struggle to find acceptance from their peers in the LGBT community.
Let’s imagine you’re trans in a best case scenario. You realize at a very early age (like, before kindergarten) Your family is supportive and well-informed. They let you have a gender-matching name. They use the correct pronouns when identifying you. You go to school as the correct gender and everyone accepts you as such. Before puberty you’ll take hormone blockers to prevent the wrong puberty from happening, and in your teens you’ll start to transition, taking hormones to trigger your body to develop as the correct gender for you (but not without seeing a psychologist who will provide the diagnosis to establish that you do indeed need to transition). Because you skipped the wrong puberty, you’ll look very passable. You’ll still need sexual reassignment surgery but you can’t do that until you’re older. If transitioning to female, SRS works well; you’ll have a vagina and you’ll be able to have a healthy sex life. If you’re a trans male, you can get SRS, but the penis you end up with will be pretty crude and won’t function as you would expect (as the saying goes, “it’s easier to dig a hole than to make a pole”).
I can’t emphasize enough how much of a best case scenario that is. It’s rare (recently Brad and Angelina’s son John is a recent example). Most trans people don’t realize that they are trans until they are older, and usually well after puberty has set in. By this point, a trans person has lived their entire life as the incorrect gender. They need to decide whether they should dismantle their entire life and identity in order to feel at home in their own skin.
Transitioning is a huge life-changing alteration and is difficult even with lots of support. It takes years. The therapists, hormone therapy and surgeries are expensive. And when you decide to live full time as your new gender, you have to come out. But it’s not like coming out as gay, where you can gradually tell people as you feel comfortable When you’re going full time you have to tell everyone you interact with on a daily basis, including your coworkers and your boss. When Coraline Ehmke went full time, she went from being a highly respected software engineer in her company to being pushed out of her job (she talked about it at the Keep Ruby Weird conference). I wasn’t lying when I mentioned dismantling your life.
Perhaps the biggest struggle is the struggle to find acceptance. HRC polled people in the US on trans issues and the results left a lot to be desired but it appears to be improving. Still, though, trans people face a lack of acceptance in greater culture, which plays a big role in mainstream public acceptance. Trans people are especially prone to being the butt of a joke; in particular, women with penises. And the joke is always the trans woman’s mere existence. You’ve never seen, say, a clip in a movie where a guy is happily with a woman with a penis and, for instance, there’s a scene where they’re both aroused about something and it’s clear they both have boners. The joke is never something relatively accepting like that. The joke is always the irony of a woman with a penis.
Dating is complicated when you’re trans. You’re expected to disclose your situation to anyone you get involved with. People expect you to disclose that pretty much right away, beacuse to not be upfront with that would imply that you’re deceitful (see the “woman with penis” trope). Heaven forbid if you could just meet someone new and casually get to know them like cis people do. Being trans, the world expects you to both anticipate and not be surprised when your date runs out on you when you disclose your gender identity. Of course, when your date tells their friends what happened, those friends will be totally understanding and they probably won’t give a thought to how it made you feel to have been rejected.
Transgender people are the most likely of any group of people to commit suicide (and it is incredibly likely; 41% of trans people in the US have attempted suicide). A trans person is murdered roughly once every three days. Substance abuse, depression and other mental issues are very high (about 25% of polled trans people engage in substance abuse).
Despite all these obstacles, trans people press on, because for them, it’s completely worth it.
We have to do a better job of making the world a better place for trans people. It starts with empathy. Appreciate their bravery and the work they put into just existing every day. Visit /r/transpassing some time to see what I mean by that. Understand which gender pronouns a person prefers. If you ever are writing about a trans person, follow GLAAD’s excellent media reference guide. Don’t be okay with transphobia, even if it’s subtle.
Being trans is inherently hard, and that may never change. But there’s plenty people can do to make it easier.

Reclaiming “It Just Works”

Everyone agrees that Apple’s software quality has taken a dive in the last couple of years. Interestingly, I hear a lot of fingers being pointed at Apple’s yearly release schedule as being too aggressive. 
That isn’t the reason quality is suffering, though. Apple’s hardware is updated yearly (or more) and has been for years and it’s been steadily improving. 
Apple’s quality is taking a nose dive because they’re making software products that are more complex than ever, and are fundamentally different from what they were doing ten years ago, and the way they develop and release their software hasn’t caught up. 
Take, for instance, the ability to send/receive SMS/MMS messages from all your devices by relaying them through iPhone. Apple advertised this as a feature of Yosemite but you can’t just install Yosemite and get SMS relay. You need 8 on your iPhone so it can actually do the relaying. And of course you need an iCloud that can receive SMSes from your iPhone and propagate them through the iMessages system. 
I doubt any of these changes were huge. Apple probably could have just added them to iOS 7 and Mavericks, but instead Apple reserves all but the most trivial of new features for new OS releases, so SMS relay, along with every other feature released in Yosemite and iOS 8, had to fight for QA testing time and tight resources in the weeks prior to their respective releases. 
But what if Apple had had added these features earlier? The teams could have worked independently and shipped their own components of the feature silently into iOS and OS X updates. They could have run rigorous functional and load testing against each part of the system, and when they had everything tested and known to be working, they could have flipped a switch to turn the feature on and market it. Since the feature is getting released by itself, it gets more special attention and it’s less likely to be forgotten in the giant pile of features Apple goes over in keynotes.
And if Apple prefers to keep the magic of a big surprise release they could have even waited till iOS 8 was out to make it official, and it could have been available for anyone who had an up-to-date Mavericks install on their Mac (if you recall, SMS relay didn’t ship with iOS 8, but rather it didn’t come out until iOS 8.1 which in turn didn’t come out until after Yosemite was released). Either way, the feature would have benefited from getting tested as thoroughly as it needs to at Apple’s scale.
I really love the ambitious pace Apple is taking with bringing out new and more awesome stuff. They probably need to bring on more engineers and probably more QA staff to help address these issues as well. But just throwing more resources won’t solve this problem. Apple’s not just doing more; the nature of what they’re building is something they’ve never done before.
Apple loves to be magical and surprise us with new stuff completely out of nowhere. But even Apple’s not immune to the complexities of large software projects. When Tim Cook made the executive shuffle that included firing Forstall, he claimed to do it in the spirit of increased collaboration between different parts of the company. We’re seeing the fruits of that now, but Apple needs to change more things unless they’re okay with a mediocre level of quality.

Using Data To Reduce Inequality

The racism we deal with today in America has evolved to be a lot more elusive than it was during the Civil Rights Movement. You can see its effects by looking at the country in aggregate. If you’re nonwhite, you’re more likely to be poor. You’re disproportionately more likely to have a run-in with the police, and when you do, you’re disproportionately more likely to be found guilty if you are prosecuted, and if you are found guilty, your sentences for the same crimes tend to be harsher than they would be if you were white.

It’s easy to see that in aggregate. You just have to measure it. But it’s more difficult to look at it on a case by case basis, because usually if there’s some racial bias happening, there’s plenty of plausible deniability surrounding it. The individual matched the description of someone who was reported to have robbed a convenience store is common in police reports, even when the individual is innocent.

Surprisingly, a technique that Tim Ferriss describes in his book The Four-Hour Body could be applicable here. In his book, he describes the importance of tracking data to lose weight. He found that merely using a scale to measure your weight every day leads to noticeable weight loss, even in the absence of any other diet or exercise regimen. Just seeing that data and being reminded of it every day is enough to affect tons of tiny, subsconscious decisions, and it made a noticeable difference.

What if we started using this technique with police officers? What if every police officer was briefed every week with the number of arrests they made, the racial breakdown of the arrests, and the racial breakdown of the local population. Using some statistics, this data could be tabulated into a score that indicates the likelihood that the officer is racially profiling civilians.

We don’t even need to give them quotas or targets to hit. We don’t need to have anyone breathing down officers’ necks about it. Hell, we don’t even need to share that data with the public. Just show it to each individual officer, as a constant reminder of the consequences of decisions they might not even be aware of. It’s so easy to think anecdotally about how fair you are, but when you see numbers that quantify it, it gets harder to rationalize.

I’m a really big fan of this technique for self-improvement, and it can be applied to any number of things. I work on a team of software engineers, and we could use data like this to help identify whether we have gender biases causing our lack of women on the team. You can use tools like RescueTime to know how much time you really spend checking your email during the work day.

On the surface, it’s just data. Just some numbers that happen to be correlated with happenings in the world. Being able to turn them into a better world is a beautiful thing.


After being inspired by a bunch of Ruby Rogues episodes and in part by my colleague Brett’s year of Ruby tips I decided to try a simple experiment in which I get into the habit of starting to document every time I encounter some new piece of information. Sometimes days pass by when I feel like I haven’t grown in any appreciable way, and this is a really great and deliberate reminder that you learn something new every day, and you learn something new and remember to make a note of it almost every day.

Being the hardcore Evernote user that I am, I started dumping these notes into a new tag called things I learned today.

It’s a great habit. I find I remember these things a little better, and even when I don’t, it doesn’t matter! I have it saved safely in Evernote! I don’t just use this for programming topics, either. I make a note any time I figure out something and think “hey, that’s neat!” or if I was trying to figure out something and it was hard to google because I had such a tenuous grasp on how to describe it (like songs where the tune is stuck in my head but I can’t remember anything about the lyrics).

Here are a few things that I learned over the past several weeks:

Refinements in irb

It turns out that due to a change after refinements were introduced in Ruby 2.0.0, they’re not nearly as easy to use and play with in an irb console. You’re better off writing them in a file and including the file in IRB if you want to play. Learn more

Markdown to Evernote

There exists a handy OS X service for taking some Markdown and sending it into an Evernote note. I love this because I love to type bulleted lists using Markdown’s bulleted list syntax, but just having plain old Markdown in my Evernote note doesn’t feel nearly as fancy. The maintainer admits he has been neglecting it a bit, but you can check it out on his blog.

Regex Postgres queries with ActiveRecord

Here’s how to construct an ActiveRecord query to find records where a field matches a regex pattern:

things_with_a_pathetic_90s_description = Thing.where("description ~ '^.*NOT!$'")

A photographic diagram of how various ingredients affect the resulting cookie. Delicious…

Rendering collections without loops

Using ERB templates in Rails, there’s a concise way you can render a partial of every item in a collection:

<%= render partial:"line_item", collection:@line_items, as: :line_item %>


I love SQL’s GROUP BY. I wanted to do something similar with a plain old Ruby array, and in the process I learned why ActiveRecord calls it group and not group_by; the method name was taken. Also, that was the best I could do at coming up with a good mnemonic device for remembering which is for which.

(1..6).group_by { |i| i%3 } #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}