Skip to content

Instantly share code, notes, and snippets.


Marc Ignacio padi

View GitHub Profile
View resque_retry.rb
# inspired by
# retry all failed Resque jobs except the ones that have already been retried
# This is, for instance, useful if you have already retried some jobs via the web interface.
Resque::Failure.count.times do |i|
Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present?
# retry all :)
Resque::Failure.count.times do |i|

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.


You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

build_package_combined_patch() {
local package_name="$1"
curl | patch -p1
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1
View genymotionwithplay.txt
Download the following ZIPs:
ARM Translation Installer v1.1 (
Download the correct GApps for your Android version:
Google Apps for Android 4.4.4 (
Google Apps for Android 4.3 (
Google Apps for Android 4.2 (
Google Apps for Android 4.1 (
padi / report.rb
Created Oct 5, 2011
Rake Task for Updating Conditions
View report.rb
desc 'Update traffic condition'
task :update_condition => :environment do
Report.all.each do |report|
report.update_attribute(:conditions, unless report.user

Literate Ruby

Inspired by Literate CoffeeScript.

$ cat
Here's a simple program

    puts "Hello, world"
$ ruby litrb.rb <
Hello, world