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
String.prototype.interpolate = function(object) { | |
return this.replace(/#{([\w0-9]+)}/g, function(val, match) { | |
return object[match]; | |
}) | |
} | |
String.prototype.evilInterpolate = function() { | |
return this.replace(/#{([\w0-9]+)}/g, function(val, match) { | |
return eval(match); | |
}); |
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 | |
require 'readline' | |
loop do | |
command = Readline.readline('> ') | |
command == "exit" && exit | |
puts "heroku #{command} --remote production" | |
system("heroku #{command} --remote production") | |
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}") |
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 | |
# USAGE | |
# | |
# Install the nokogiri gem by running (it might need sudo): | |
# | |
# $ gem install nokogiri | |
# | |
# Get a random slogan: | |
# | |
# $ slogan |
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
>> 15.minutes.class | |
=> Fixnum | |
>> Object.instance_method(:class).bind(15.minutes).call | |
=> ActiveSupport::Duration |
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 'open-uri' | |
desc "Run a remote script from ENV['REMOTE_URL']" | |
task :remote => :environment do | |
instance_eval(open(ENV['REMOTE_URL']).read) | |
end |