out of time
mat brown on programming, politics, cooking, and assorted nerdiness
-
Five Android Customization Apps I Can’t Live Without
CommentsI recently upgraded to a Samsung Droid Charge, which overall I’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’t feel complete without them.
LauncherPro
A replacement for the Android home screen and app drawer, LauncherPro lets you tweak just about everything about that basic bit of the phone’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’m not stuck with the ridiculous bloatware that Verizon saw fit to ship with my phone and prevent me from uninstalling.
Dialer One
A replacement for the standard Phone app, Dialer One’s killer feature is that the dialpad doubles as a T9 filter for your contacts. It’s a much, much faster way to look up who you want to call than anything else I’ve come across on a smartphone.
SwiftKey X
This is the only paid app on today’s list, but it’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’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.
Handcent SMS
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.
Llama
Unlike the other apps on this list, Llama isn’t an in-kind replacement for an app that ships with Android; but it’s a general-purpose system tool, so I’ve included it here. Llama’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’s not a battery-killer. This may sound familiar to those who have come across the more popular Tasker, but I prefer Llama’s feature set and functionality even before considering that Llama is free and Tasker is not. Here’s what I use Llama for:
- Turn Wi-Fi on when I’m at home or in the office; turn it off otherwise.
- Turn off vibrate when the phone is plugged in (since that means it’s sitting on a desk and the vibrate will be loud and annoying).
- Turn down my screen brightness and disable sync when my battery drops below 40%.
That’s just a small taste of what Llama’s capable of, but even just using it for those few simple things makes my phone way better to use.
That is all.
-
This is a good kitten.
Comments -
This is a good puppy.
Comments -
This is a good puppy.
Comments -
This is a good puppy.
Comments -
Screentopia!
CommentsI’m a big fan of GNU Screen. Split-screen is indispensable for writing code, and it’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.
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’ve had is that, if I use screen to open a non-shell process (e.g. vim), it doesn’t carry the environment variables set in my
.bashrcover. This makes sense when you think about what is going on:gnome-terminalstartsgnome-terminalspawns ascreenprocessscreenspawns abashprocess, which inhabits window 0- From that
bashprocess, I typescreen vim ., which causesscreento spawn avimprocess.
Thus, the process ancestry for vim is:
vim>screen>gnome-terminal. At no point is there abashin there to load the.bashrcand set up the environment.I played with a few different solutions, but finally came up with a pretty simple one. Here are the steps.
- Create a
.bash_envfile in your home directory. Move your environment variable declarations to there. - Add the line
. ~/.bash_envto your.bashrc - Create the following script
startscreensomewhere (I keep my personal scripts in~/.local/bin):
#! /bin/bash . ~/.bash_env screen- Make your
startscreenscript executable. - Set your
gnome-terminalcustom command to~/.local/bin/startscreen(or wherever you put it).
And you’re set!
-
Test after_commit hooks with transactional fixtures enabled
CommentsRails 3 introduced
after_commitandafter_rollbackhooks, which are quite useful for situations in which a call to an external service relies on a consistent database state from that service’s perspective. Unfortunately, out of the box, it’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’t fire at the end of the transactions that happen within your tests, because those aren’t real transactions; they’re savepoints (most relational databases don’t support true nested transactions).Anywho, turns out it’s pretty straightforward to monkey-patch ActiveRecord to fire the
after_commitcallback in the situation we’d expect in our tests — namely, when there’s exactly one open transaction on the transaction stack. Here’s the bacon:Just require that somewhere from your
spec_helperand you’re good to go. -
This is a good puppy.
Comments -
This is a good puppy.
Comments -
Use backup gem with Heroku’s pgbackups
CommentsThe backup library is a powerful, flexible, easy-to-use way to configure and execute data backups for your Ruby app. It doesn’t support Heroku’s pgbackups out of the box, but the library has an excellent modular design, making it dead simple to code up a module for pgbackups.
Here’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!
To configure it, just set the
nameto the name of your Heroku app: