<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>mat brown on programming, politics, cooking, and assorted nerdiness</description><title>out of time</title><generator>Tumblr (3.0; @0utoftime)</generator><link>http://outofti.me/</link><item><title>Five Android Customization Apps I Can't Live Without</title><description>&lt;p&gt;I recently upgraded to a &lt;a href="http://www.samsung.com/us/mobile/cell-phones/SCH-I510RAAVZW" target="_blank"&gt;Samsung Droid Charge&lt;/a&gt;, which overall I&amp;#8217;m quite pleased with. With the clean slate provided by the new phone, I immediately set to installing and configuring things to my liking. Below are five apps that replace, extend, or enhance functionality that ships with the phone; my system wouldn&amp;#8217;t feel complete without them.&lt;/p&gt;

&lt;h3&gt;&lt;a href="https://market.android.com/details?id=com.fede.launcher" target="_blank"&gt;LauncherPro&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;A replacement for the Android home screen and app drawer, LauncherPro lets you tweak just about everything about that basic bit of the phone&amp;#8217;s experience. A couple of my favorite features: the dock at the bottom of the home screen is totally customizable; and the app drawer allows you to hide applications, crucially letting me pretend that I&amp;#8217;m not stuck with the ridiculous bloatware that Verizon saw fit to ship with my phone and prevent me from uninstalling.&lt;/p&gt;

&lt;h3&gt;&lt;a href="https://market.android.com/details?id=kz.mek.DialerOne" target="_blank"&gt;Dialer One&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;A replacement for the standard Phone app, Dialer One&amp;#8217;s killer feature is that the dialpad doubles as a T9 filter for your contacts. It&amp;#8217;s a much, much faster way to look up who you want to call than anything else I&amp;#8217;ve come across on a smartphone.&lt;/p&gt;

&lt;h3&gt;&lt;a href="https://market.android.com/details?id=com.touchtype.swiftkey" target="_blank"&gt;SwiftKey X&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;This is the only paid app on today&amp;#8217;s list, but it&amp;#8217;s well worth it. SwiftKey is a replacement soft keyboard. Unlike some of the more adventurous keyboard replacements out there, SwiftKey looks pretty much exactly like the built-in keyboard; the difference is in the predictions and autocorrection. SwiftKey uses semantic analysis to guess what you&amp;#8217;re going to type next based on the last few words you entered. It also learns from your typing style, and you can even set it up to read your tweets, Facebook messages, SMS, etc. to learn more about the words and phrases you use most often.&lt;/p&gt;

&lt;h3&gt;&lt;a href="https://market.android.com/details?id=com.handcent.nextsms" target="_blank"&gt;Handcent SMS&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Handcent is the SMS app of choice among Android power users; like other apps on this list, it boasts considerably more flexibility than the built-in alternative. Among other SMS enhancements, Handcent can display SMSs in a pop-up notification on the screen, and even allows you to reply to them without even opening the app.&lt;/p&gt;

&lt;h3&gt;&lt;a href="https://market.android.com/details?id=com.kebab.Llama" target="_blank"&gt;Llama&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Unlike the other apps on this list, Llama isn&amp;#8217;t an in-kind replacement for an app that ships with Android; but it&amp;#8217;s a general-purpose system tool, so I&amp;#8217;ve included it here. Llama&amp;#8217;s purpose is to automate features of your phone based on various conditions being met. In particular, it allows you to configure location profiles for various places you frequent; it uses cell tower polling, rather than GPS, to tell where you are, so it&amp;#8217;s not a battery-killer. This may sound familiar to those who have come across the more popular &lt;a href="https://market.android.com/details?id=net.dinglisch.android.taskerm" target="_blank"&gt;Tasker&lt;/a&gt;, but I prefer Llama&amp;#8217;s feature set and functionality even before considering that Llama is free and Tasker is not. Here&amp;#8217;s what I use Llama for:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Turn Wi-Fi on when I&amp;#8217;m at home or in the office; turn it off otherwise.&lt;/li&gt;
&lt;li&gt;Turn off vibrate when the phone is plugged in (since that means it&amp;#8217;s sitting on a desk and the vibrate will be loud and annoying).&lt;/li&gt;
&lt;li&gt;Turn down my screen brightness and disable sync when my battery drops below 40%.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;That&amp;#8217;s just a small taste of what Llama&amp;#8217;s capable of, but even just using it for those few simple things makes my phone way better to use.&lt;/p&gt;

&lt;h3&gt;That is all.&lt;/h3&gt;</description><link>http://outofti.me/post/8865738143</link><guid>http://outofti.me/post/8865738143</guid><pubDate>Sat, 13 Aug 2011 10:42:45 -0400</pubDate></item><item><title>This is a good kitten.</title><description>&lt;a href="http://www.dailykitten.com/2011/06/sunny-3/"&gt;This is a good kitten.&lt;/a&gt;</description><link>http://outofti.me/post/6619635959</link><guid>http://outofti.me/post/6619635959</guid><pubDate>Fri, 17 Jun 2011 08:52:03 -0400</pubDate></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/stella-the-mastiff-mix_2011-06-09"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/6351041244</link><guid>http://outofti.me/post/6351041244</guid><pubDate>Thu, 09 Jun 2011 07:56:11 -0400</pubDate></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/lucy-the-labrador-retriever_2011-06-06"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/6283052154</link><guid>http://outofti.me/post/6283052154</guid><pubDate>Tue, 07 Jun 2011 08:49:09 -0400</pubDate></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/lily-the-golden-retriever_2011-05-20"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/5664975872</link><guid>http://outofti.me/post/5664975872</guid><pubDate>Fri, 20 May 2011 07:52:33 -0400</pubDate></item><item><title>Screentopia!</title><description>&lt;p&gt;I&amp;#8217;m a big fan of &lt;a href="http://www.gnu.org/software/screen/" target="_blank"&gt;GNU Screen&lt;/a&gt;. Split-screen is indispensable for writing code, and it&amp;#8217;s convenient to be able to run a bunch of interactive processes and switch between them really easily (control-A [0-9]). I like screen, so much, that I never want to use a terminal emulator without it.&lt;/p&gt;

&lt;p&gt;So, to that end, I generally set up gnome-terminal to execute screen at startup. That way, when I exit my last screen window, the whole terminal exits, which is what I want. This generally works quite well, but one problem I&amp;#8217;ve had is that, if I use screen to open a non-shell process (e.g. vim), it doesn&amp;#8217;t carry the environment variables set in my &lt;code&gt;.bashrc&lt;/code&gt; over. This makes sense when you think about what is going on:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;code&gt;gnome-terminal&lt;/code&gt; starts&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gnome-terminal&lt;/code&gt; spawns a &lt;code&gt;screen&lt;/code&gt; process&lt;/li&gt;
&lt;li&gt;&lt;code&gt;screen&lt;/code&gt; spawns a &lt;code&gt;bash&lt;/code&gt; process, which inhabits window 0&lt;/li&gt;
&lt;li&gt;From that &lt;code&gt;bash&lt;/code&gt; process, I type &lt;code&gt;screen vim .&lt;/code&gt;, which causes &lt;code&gt;screen&lt;/code&gt; to spawn a &lt;code&gt;vim&lt;/code&gt; process.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Thus, the process ancestry for vim is: &lt;code&gt;vim&lt;/code&gt; &amp;gt; &lt;code&gt;screen&lt;/code&gt; &amp;gt; &lt;code&gt;gnome-terminal&lt;/code&gt;. At no point is there a &lt;code&gt;bash&lt;/code&gt; in there to load the &lt;code&gt;.bashrc&lt;/code&gt; and set up the environment.&lt;/p&gt;

&lt;p&gt;I played with a few different solutions, but finally came up with a pretty simple one. Here are the steps.&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Create a &lt;code&gt;.bash_env&lt;/code&gt; file in your home directory. Move your environment variable declarations to there.&lt;/li&gt;
&lt;li&gt;Add the line &lt;code&gt;. ~/.bash_env&lt;/code&gt; to your &lt;code&gt;.bashrc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create the following script &lt;code&gt;startscreen&lt;/code&gt; somewhere (I keep my personal scripts in &lt;code&gt;~/.local/bin&lt;/code&gt;):&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;&lt;code&gt;#! /bin/bash

. ~/.bash_env
screen&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;&lt;li&gt;Make your &lt;code&gt;startscreen&lt;/code&gt; script executable.&lt;/li&gt;
&lt;li&gt;Set your &lt;code&gt;gnome-terminal&lt;/code&gt; custom command to &lt;code&gt;~/.local/bin/startscreen&lt;/code&gt; (or wherever you put it).&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;And you&amp;#8217;re set!&lt;/p&gt;</description><link>http://outofti.me/post/5042037209</link><guid>http://outofti.me/post/5042037209</guid><pubDate>Fri, 29 Apr 2011 10:51:43 -0400</pubDate></item><item><title>Test after_commit hooks with transactional fixtures enabled</title><description>&lt;p&gt;Rails 3 introduced &lt;code&gt;after_commit&lt;/code&gt; and &lt;code&gt;after_rollback&lt;/code&gt; hooks, which are quite useful for situations in which a call to an external service relies on a consistent database state from that service&amp;#8217;s perspective. Unfortunately, out of the box, it&amp;#8217;s quite difficult to test these hooks, because Rails by default wraps each test case in a database transaction (rolling this transaction back at the end of each test maintains test isolation much more efficiently than manually deleting everything from your database). So, after_commit doesn&amp;#8217;t fire at the end of the transactions that happen &lt;em&gt;within&lt;/em&gt; your tests, because those aren&amp;#8217;t real transactions; they&amp;#8217;re savepoints (most relational databases don&amp;#8217;t support true nested transactions).&lt;/p&gt;

&lt;p&gt;Anywho, turns out it&amp;#8217;s pretty straightforward to monkey-patch ActiveRecord to fire the &lt;code&gt;after_commit&lt;/code&gt; callback in the situation we&amp;#8217;d expect in our tests &amp;#8212; namely, when there&amp;#8217;s exactly one open transaction on the transaction stack. Here&amp;#8217;s the bacon:&lt;/p&gt;

&lt;script src="https://gist.github.com/931623.js?file=after_commit_with_transactional_fixtures.rb"&gt;&lt;/script&gt;&lt;p&gt;Just require that somewhere from your &lt;code&gt;spec_helper&lt;/code&gt; and you&amp;#8217;re good to go.&lt;/p&gt;</description><link>http://outofti.me/post/4777884779</link><guid>http://outofti.me/post/4777884779</guid><pubDate>Wed, 20 Apr 2011 11:27:18 -0400</pubDate></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/abe-the-labrador-retriever_2011-04-11"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/4526394367</link><guid>http://outofti.me/post/4526394367</guid><pubDate>Mon, 11 Apr 2011 10:23:07 -0400</pubDate></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/molly-the-mixed-breed_2011-04-03"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/4310948376</link><guid>http://outofti.me/post/4310948376</guid><pubDate>Sun, 03 Apr 2011 10:27:04 -0400</pubDate></item><item><title>Use backup gem with Heroku's pgbackups</title><description>&lt;p&gt;The &lt;a href="https://github.com/meskyanichi/backup/" target="_blank"&gt;backup&lt;/a&gt; library is a powerful, flexible, easy-to-use way to configure and execute data backups for your Ruby app. It doesn&amp;#8217;t support &lt;a href="http://devcenter.heroku.com/articles/pgbackups" target="_blank"&gt;Heroku&amp;#8217;s pgbackups&lt;/a&gt; out of the box, but the library has an excellent modular design, making it dead simple to code up a module for pgbackups.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s my quick-and-dirty crack at it. It works, but has basically no configuration options (not that pgbackups itself has a great deal anyway). Hope you find it useful!&lt;/p&gt;

&lt;script src="https://gist.github.com/890564.js?file=heroku_pgbackups.rb"&gt;&lt;/script&gt;&lt;p&gt;To configure it, just set the &lt;code&gt;name&lt;/code&gt; to the name of your Heroku app:&lt;/p&gt;

&lt;script src="https://gist.github.com/890564.js?file=config.rb"&gt;&lt;/script&gt;</description><link>http://outofti.me/post/4159686269</link><guid>http://outofti.me/post/4159686269</guid><pubDate>Mon, 28 Mar 2011 10:36:58 -0400</pubDate><category>programming</category></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/buffy-the-labrador-retriever_2011-03-22"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/4067042744</link><guid>http://outofti.me/post/4067042744</guid><pubDate>Thu, 24 Mar 2011 14:30:11 -0400</pubDate></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/larkin-the-labrador-retriever_2011-03-18"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/3939086469</link><guid>http://outofti.me/post/3939086469</guid><pubDate>Fri, 18 Mar 2011 08:26:51 -0400</pubDate></item><item><title>This is a reasonably good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/amber-the-cavalier-king-charles-spaniel_2011-03-12"&gt;This is a reasonably good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/3807957330</link><guid>http://outofti.me/post/3807957330</guid><pubDate>Sat, 12 Mar 2011 11:02:10 -0500</pubDate></item><item><title>Voting rights</title><description>&lt;p&gt;Non-driver ID cards in Wisconsin &lt;a href="http://www.dot.wisconsin.gov/drivers/drivers/driver-fees.htm#identification" target="_blank"&gt;cost $28&lt;/a&gt;. Doesn&amp;#8217;t that make &lt;a href="http://lacrossetribune.com/news/state-and-regional/wi/article_c3a0a5ee-3ebe-11e0-b641-001cc4c002e0.html" target="_blank"&gt;this bill a poll tax&lt;/a&gt;? And isn&amp;#8217;t that in violation of Section 10 of the &lt;a href="http://www.ourdocuments.gov/doc.php?flash=true&amp;amp;doc=100&amp;amp;page=transcript" target="_blank"&gt;Voting Rights Act&lt;/a&gt;, which is the law that enforces the &lt;a href="http://www.usconstitution.net/const.html#Am15" target="_blank"&gt;15th Amendment&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;Just checking.&lt;/p&gt;</description><link>http://outofti.me/post/3485225949</link><guid>http://outofti.me/post/3485225949</guid><pubDate>Thu, 24 Feb 2011 12:15:58 -0500</pubDate><category>politics</category></item><item><title>Using ENUMs with Rails</title><description>&lt;a href="http://seejohncode.com/2011/02/18/enums-with-rails.html"&gt;Using ENUMs with Rails&lt;/a&gt;: &lt;p&gt;Great article by friend and former colleague John Crepezzi. John and I both think Rails developers should focus more on using databases as they were intended to be; Rails tends to move a lot of database-layer considerations (column lengths, “uniqueness”, nullability, relational integrity, etc.) improperly into the application layer. If you’re looking to take better advantage of the features your database already supports, this is a great place to start.&lt;/p&gt;</description><link>http://outofti.me/post/3446902737</link><guid>http://outofti.me/post/3446902737</guid><pubDate>Tue, 22 Feb 2011 12:44:31 -0500</pubDate></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/lexi-the-beagle_2011-02-16"&gt;This is a good puppy.&lt;/a&gt;: &lt;p&gt;I mean, it’s really, really good.&lt;/p&gt;</description><link>http://outofti.me/post/3329878252</link><guid>http://outofti.me/post/3329878252</guid><pubDate>Wed, 16 Feb 2011 14:09:27 -0500</pubDate></item><item><title>NewRelic metrics for Mongoid</title><description>&lt;p&gt;The &lt;a href="https://github.com/newrelic/rpm_contrib" target="_blank"&gt;rpm_contrib&lt;/a&gt; project provides a one-stop shop for monitoring lots of services commonly used in Rails apps. It&amp;#8217;s got an instrumentation module for Mongoid, but unfortunately it doesn&amp;#8217;t work (at least in Mongoid 2.0), because it&amp;#8217;s instrumenting on methods on &lt;code&gt;Mongoid::Document&lt;/code&gt; that may or may not actually be called in the course of a query. Happily, we can add full instrumentation for Mongoid by adding traces to the &lt;code&gt;Mongoid::Collection&lt;/code&gt; class instead &amp;#8212; this is the lowest layer of the Mongoid library before it starts making calls directly to the Mongo driver:&lt;/p&gt;

&lt;script src="https://gist.github.com/822461.js?file=collection.rb"&gt;&lt;/script&gt;&lt;p&gt;Of course I&amp;#8217;ll contribute this back upstream to rpm_contrib at some point, but until I find the time, feel free to enjoy the above.&lt;/p&gt;</description><link>http://outofti.me/post/3234243601</link><guid>http://outofti.me/post/3234243601</guid><pubDate>Fri, 11 Feb 2011 10:07:06 -0500</pubDate></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/bentley-the-labrador-retriever_2011-02-09"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/3198057753</link><guid>http://outofti.me/post/3198057753</guid><pubDate>Wed, 09 Feb 2011 08:01:44 -0500</pubDate><category>puppies</category></item><item><title>This is a good puppy.</title><description>&lt;a href="http://www.dailypuppy.com/puppies/cooper-the-pembroke-welsh-corgi_2011-02-07"&gt;This is a good puppy.&lt;/a&gt;</description><link>http://outofti.me/post/3164700594</link><guid>http://outofti.me/post/3164700594</guid><pubDate>Mon, 07 Feb 2011 11:13:00 -0500</pubDate><category>puppies</category></item><item><title>http://xkcd.com/854/</title><description>&lt;a href="http://xkcd.com/854/"&gt;http://xkcd.com/854/&lt;/a&gt;</description><link>http://outofti.me/post/3030900476</link><guid>http://outofti.me/post/3030900476</guid><pubDate>Mon, 31 Jan 2011 09:34:34 -0500</pubDate><category>cooking</category></item></channel></rss>

