This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '3.0.0' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
group :development do | |
gem 'sqlite3-ruby', :require => 'sqlite3' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" | |
installer | |
end | |
# - alternative method - override bundle and exec the install ourselves. | |
# def bundle | |
# info "~> Bundling gems" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/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 = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(nil, 'HAHAHA') | |
=> nil | |
ree-1.8.7-2010.02 > !! fucker | |
=> true | |
ree-1.8.7-2010.02 > fucker.nil? | |
=> true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
def map_values(&block) | |
inject(Hash.new) do |hsh, (k, v)| | |
hsh[k] = yield(v) | |
hsh | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You can run this on your server by doing this: | |
# bash -c "`wget -O - frozenplague.net/boris`" | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The query: | |
select episodes.id 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1_000_000.times do |i| | |
String.new | |
if i % 1000 == 0 | |
puts ObjectSpace.each_object { } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
`find /var/www/vhosts/santosdumont.com/web_users/ -type f`.split("\n").each do |file| | |
basename = File.basename(file) | |
system("mv", file, "/var/www/vhosts/santosdumont.com/httpdocs/Resource/" + basename) | |
end | |