Skip to content

Instantly share code, notes, and snippets.

JD wuputah

Block or report user

Report or block wuputah

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:605328
source ''
gem 'rails', '3.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://'
group :development do
gem 'sqlite3-ruby', :require => 'sqlite3'
View eydeploy.rb
# in ey-deploy 1.1.0, we just need to add without clauses
def get_bundler_installer(*)
installer = super
installer.options << " --without cucumber test development"
# - alternative method - override bundle and exec the install ourselves.
# def bundle
# info "~> Bundling gems"
View gist:485167
~/p/wegowise (master) % sc
Loading development environment (Rails 2.3.5)
ree-1.8.7-2010.02 > require 'active_support'
=> []
ree-1.8.7-2010.02 > fucker =, 'HAHAHA')
=> nil
ree-1.8.7-2010.02 > !! fucker
=> true
ree-1.8.7-2010.02 > fucker.nil?
=> true
View gist:465884
class Hash
def map_values(&block)
inject( do |hsh, (k, v)|
hsh[k] = yield(v)
View gist:249619
# You can run this on your server by doing this:
# bash -c "`wget -O -`"
# If you don't have wget, use curl.
echo "Need your password to install things:"
sudo apt-get -y update
sudo apt-get -y install build-essential mysql-server libmysqlclient15-dev apache2 libssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev zlib1g zlib1g-dev
pushd /tmp
View gist:66777
The query:
select from episodes
left outer join links on links.link_id = episodes.link_id
where episodes.link_id > 0 and links.link_id is NULL
The Rails:
Episode.find(:all, :include => :link, :conditions => "episodes.link_id > 0 and links.link_id is NULL")
View gist:64454
1_000_000.times do |i|
if i % 1000 == 0
puts ObjectSpace.each_object { }
View gist:15387
#!/usr/bin/env ruby
`find /var/www/vhosts/ -type f`.split("\n").each do |file|
basename = File.basename(file)
system("mv", file, "/var/www/vhosts/" + basename)
You can’t perform that action at this time.