Skip to content

Instantly share code, notes, and snippets.

View padi's full-sized avatar

Marc Ignacio padi

View GitHub Profile
# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs
# 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?
end
# retry all :)
Resque::Failure.count.times do |i|
@padi
padi / tmux.md
Created February 19, 2014 07:09 — forked from andreyvit/tmux.md

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.

Requirements

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 https://raw.github.com/gist/4136373/falcon-gc.diff | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?w=files&flid=15801)
Google Apps for Android 4.3 (http://goo.im/gapps/gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (http://goo.im/gapps/gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (http://goo.im/gapps/gapps-jb-20121011-signed.zip)
@padi
padi / shell
Created September 6, 2011 06:44
How to lose your merge commit
marcrendlignacio:~/RebaseAfterMerge: development$ git log -p
commit 36b2f0ddba699197acfb4540bfe21113342e6c2a
Merge: 2e51d47 17e1525
Author: Padi Ignacio <marcrendlignacio@gmail.com>
Date: Tue Sep 6 14:18:46 2011 +0800
Merge branch 'feature-1' into development <<< watch this commit disappear.
commit 17e1525836ca186b7936a81dd6a4a6b6b2b0b0bc
Author: Padi Ignacio <marcrendlignacio@gmail.com>
@padi
padi / tubigNaAso.rb
Created September 9, 2011 18:25
Tubig na Aso
class Aso
def initialize(name)
@name = name
end
end
class TubigNaAso < Aso
def initialize name
@name = "TubigNa" + name
end
Then /^there should be a report "([^"]*)" with the condition "([^"]*)" from (?:"([^"]*)"|anonymous)$/ do |text, condition, username|
Report.last.text.should == text
Report.last.conditions.should == [condition]
Report.last.username.should == username
end