Jan 14

Bash Lessons

bash notetoself rbenv grokking | comments

Disclaimer 1: before all the haters talk: I'm not that well versed with bash (something I'm going to correct in year 2012 though.

Disclaimer 2: I discovered most of the commands / lessons here while trying to peruse

Continue reading »

Dec 23

iTerm2 tips & tricks

iterm2 tips tricks productivity | comments

Jumping to the start and end of the line

In case you didn't know, you can jump to the start or end of the line using Ctrl-a or Ctrl-e when you're in the command line.

Map Ctrl-a to Cmd ←

Continue reading »

Dec 07

VIM Tips

vim tips | comments

:w !sudo tee %      # Write to a file you don't have permission to
:options            # to show all the `set` options
:verbose set sts    # shows where sts was set

Nov 27

Simple Mailer

simplest occams mailer | comments

I know there are tons of emailing solutions for Ruby out there. But most of them come with thousands of lines of code.

Here is my simple rendition, inspired from soveran's gist a few months back:

Continue reading »

Oct 06

Improving the load time of your application

performance loadtime ruby sinatra monk | comments

Step 0: Benchmark!

(Disclaimer: the code that follows is in no way a prescription on how to write good benchmarking code but was simply written in a minute :-)

Continue reading »

Oct 05

Ohm-Contrib: Quick Start

ohm ohm-contrib redis | comments

Since Ohm-Contrib was released on May 11, 2010, a lot of changes, cool features, and small removals have happened. This blog post is an attempt to summarize what's available and most useful, although I won't attempt to

Continue reading »

Oct 04

Peons: A simple fail-safe queue

redis errorsafe queue worker peons | comments


n. Hard working dependable slaves, with a keen attention to mining your gold.

If you have been doing a lot of web apps lately, chances are that you have noticed the massive attention towards background processing queues. Peons is just a simple, yet robust attempt, to solve the same problem, albeit with less code.

Continue reading »

Aug 05

Fuzzy searching in SOLR with Sunspot

solr sunspot ohm fuzzy | comments

At one point or another, you'll need this functionality:

Find all people whose names start with Jo Sm <- (i.e. the famous John Smith)

Step 1. Make it work

How do we go about that in SOLR (specifically using sunspot?). Here's my brain dump based off of a gist:

Continue reading »

Jul 22

Dtach is the way

daemon ruby background worker | comments

If you have a worker that doesn't stop (looping endlessly and waiting for some queue to have a job), you might want to have the ability to put this worker in the background for the following reasons:

Continue reading »

Jul 06

Upgrading our existing app to OOR Ohm

ohm oor redis | comments

OOR - Object Oriented Redis.

1. key(:something) is dead, long live key[:something]

Basically you just have to change the method signature. An example follows:

Continue reading »