Skip to content

Instantly share code, notes, and snippets.

View imajes's full-sized avatar

James Cox imajes

View GitHub Profile
% rbenv install 1.9.3-p194
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /home/deploy/.rbenv/versions/1.9.3-p194
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz...
Installing ruby-1.9.3-p194...
Installed ruby-1.9.3-p194 to /home/deploy/.rbenv/versions/1.9.3-p194
ruby: no such file to load -- ubygems (LoadError)
@imajes
imajes / Gemfile
Created February 1, 2012 18:18
make ruby debug work in 1.9.3 with bundler
gem 'ruby-debug19', '0.11.6', :require => 'ruby-debug'
# FIXME: forcing rdebug to work on 1.9.3
gem 'linecache19', '0.5.13'
gem 'ruby-debug-base19', '0.11.26'
remote: /data/github/current/lib/github/config/resque.rb:27: undefined method `constantize' for "GitHub::Jobs::CacheRef":String (NoMethodError)
remote: from /data/github/current/lib/github/config/resque.rb:26:in `each'
remote: from /data/github/current/lib/github/config/resque.rb:26
remote: from /data/github/current/lib/rock_queue.rb:9:in `require'
remote: from /data/github/current/lib/rock_queue.rb:9
remote: from hooks/post-receive:27:in `require'
remote: from hooks/post-receive:27
@imajes
imajes / turntable.user.js
Created November 29, 2011 18:05
fluid user script for turntable.fm to alert growl
function setNP(str) {
window.nowPlaying = str;
}
function nowPlaying() {
return window.nowPlaying;
}
setTimeout(updateGrowl, 1000);
RAILSPID=`ps -ef|grep rails|grep -v grep|awk '{ print $2 }'`
if [ -n $RAILSPID ]; then
kill -9 $RAILSPID
fi
class Foo
has_one :image
def process_stuff
img = Image.first
img.with_temp_file('/path/to/tmpfile') do |tf|
tf.rotate
write(1, "ree-1.8.7-2011.03 :13422 > ", 29) = -1 EIO (Input/output error)
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
select(2, [0], [], [], {16, 522108}) = 1 (in [0], left {16, 522108})
select(1, [0], NULL, [0], {0, 100000}) = 1 (in [0], left {0, 100000})
ioctl(0, FIONREAD, [0]) = -1 EIO (Input/output error)
write(1, "\n", 1) = -1 EIO (Input/output error)
rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff8dd1d710) = -1 EIO (Input/output error)
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B9600 opost isig icanon echo ...}) = -1 EIO (Input/output error)
stat("/home/deploy/apps/village/staging/current/vendor/plugins/formtastic_datepicker_inputs/lib/active_messaging", 0x7fffb4e98400) = -1 ENOENT (No such file or directory)
stat("/home/deploy/apps/village/staging/shared/bundle/ruby/1.8/gems/formtastic-2.0.2/app/assets/active_messaging", 0x7fffb4e98400) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2ac6fc56c430) = 30064
rt_sigaction(SIGVTALRM, {0x410df0, [], SA_RESTORER, 0x2ac6fbad2af0}, {0x410df0, [], SA_RESTORER, 0x2ac6fbad2af0}, 8) = 0
setitimer(ITIMER_VIRTUAL, {it_interval={0, 10000}, it_value={0, 10000}}, NULL) = 0
stat("/home/deploy/apps/village/staging/current/lib/active_merchant/billing/gateway.rb", 0x7fffb4e9ac50) = -1 ENOENT (No such file or directory)
stat("/home/deploy/apps/village/staging/current/lib/act
rt_sigaction(SIGVTALRM, {0x410df0, [], SA_RESTORER, 0x2ac6fbad2af0}, {0x410df0, [], SA_RESTORER, 0x2ac6fbad2af0}, 8) = 0
setitimer(ITIMER_VIRTUAL, {it_interval={0, 10000}, it_value={0, 10000}}, NULL) = 0
setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
exit_group(1) = ?
@imajes
imajes / new_relic.fluid.user.js
Created October 4, 2011 01:31
Fluid/ New Relic user script
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var status = document.getElementsByClassName("app_status_info")[1]
var thruput = status.children[0].innerText;
window.fluid.dockBadge = thruput;
}