Skip to content

Instantly share code, notes, and snippets.

View jschoolcraft's full-sized avatar

Jeff Schoolcraft jschoolcraft

View GitHub Profile
# from => http://pastie.org/68511
# [email protected]
require 'osx/cocoa'
require 'logger'
OSX.require_framework 'WebKit'
class Shooter
# http://www.bencurtis.com/wp-content/uploads/2008/05/snapper.rb
#!/usr/bin/env ruby
# Thanks to the heavy lifting done by others:
# http://pastie.caboo.se/69235
# http://pastie.caboo.se/68511
require 'osx/cocoa'
OSX.require_framework 'WebKit'
@jschoolcraft
jschoolcraft / .gitignore
Created December 22, 2009 13:42 — forked from mdp/.gitignore
mturk.yml
oi.destroy
SQL (0.1ms) BEGIN
Version Delete all (0.3ms) DELETE FROM "versions" WHERE ((versioned_id = 1059704) AND (versioned_type = 'OrderItem'))
OrderItem Destroy (0.2ms) DELETE FROM "order_items" WHERE "id" = 1059704
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
[~] irb
irb(main):001:0> "jeff".to_i
=> 0
irb(main):002:0> Integer("jeff")
ArgumentError: invalid value for Integer: "jeff"
from (irb):2:in `Integer'
from (irb):2
irb(main):003:0> "23jeff".to_i
=> 23
irb(main):004:0> Integer("23")
def elad_to_i(num)
num =~ /^\d+$/ ? num.to_i : "fuck you asshole, it's not a number"
end
@jschoolcraft
jschoolcraft / Gemfile
Created January 27, 2010 14:22 — forked from rmanalan/.gems
gem 'rack-contrib', :git => 'git://github.com/rack/rack-contrib.git'
gem 'rack-rewrite'
* [master][~/code/msm] rake spec
(in /Users/jschoolcraft/code/msm)
zsh: virtual time alarm rake spec
* [master][~/code/msm] rake spec --trace
(in /Users/jschoolcraft/code/msm)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/Formula/...
/usr/local/Library/Homebrew/...
==> The following directories will be made group writable:
/usr/local/bin
/usr/local/.
==> The following directories will have their group set to staff:
/usr/local/bin
/usr/local/.