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 | |
flips = [ | |
'(╯°□°)╯︵ ┻━┻', | |
'(ノಥ益ಥ)ノ ┻━┻', | |
'┬──┬ ¯\_(ツ)', | |
'┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻', | |
'┻━┻ ︵ ¯\(ツ)/¯ ︵ ┻━┻', | |
'┬─┬ノ( º _ ºノ)', | |
'(ノಠ益ಠ)ノ彡┻━┻' |
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
coffee> if true then "OK" else "UH OH" | |
'OK' | |
coffee> if false then "OK" else "UH OH" | |
'UH OH' |
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
require "rubygems" | |
require "acts_as_fu" | |
require "test/unit" | |
include ActsAsFu | |
class ActiveRecord::Base | |
def self.after_set(attribute, callback) | |
after_save callback, :if => "#{attribute}_set?" | |
class_eval <<-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
it "saves cleanly from builder" do | |
create_${TM_FILENAME/(\w+)_spec\.rb/$1/}.should_not be_a_new_record | |
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
wget http://chromium.googlecode.com/files/chromedriver_mac_14.0.836.0.zip | |
unzip chromedriver_mac_14.0.836.0.zip | |
mv chromedriver /usr/local/bin/ | |
rm -f chromedriver_mac_14.0.836.0.zip |
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
/****************************************************************************** | |
.js/pivotaltracker.com.js | |
Get dotjs here: http://defunkt.io/dotjs | |
Extracted from my dotjs files: https://github.com/nakajima/nakajima-dot-js | |
******************************************************************************/ |
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
## | |
# Downloads a bunch of Goldeneye N64 videos. You're welcome. | |
## | |
require "rubygems" | |
require "nokogiri" | |
require "open-uri" | |
doc = Nokogiri(open("http://www.archive.org/details/GoldenEye_SecretAgent").read) | |
doc.at('table.fileFormats') \ | |
.search('a') \ |
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
- if user_signed_in? | |
Welcome, #{link_to current_user.first_name, user_path(current_user)} | |
= link_to "Sign out", logout_path | |
- else | |
= form_for :user, :url => login_path do |f| | |
= f.label :email | |
= f.text_field :email | |
%br | |
= f.label :password | |
= f.password_field :password |
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
Poundie.before do |message| | |
message.body.gsub! /^poundie/, "matt" | |
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 | |
gemspec = Dir['*.gemspec'].first | |
gemspec || abort("You need to have a gem spec in this directory.") | |
system("gem build #{gemspec}") | |
gemfile = Dir['*.gem'].sort.last | |
system("gem push #{gemfile}") && system("rm #{gemfile}") |