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
module Kernel | |
alias :old_puts :puts | |
def puts(val) | |
old_puts val | |
old_puts caller.inspect | |
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
# List of environments and their heroku git remotes (id: 'remote_name') | |
HEROKU_ENVIRONMENTS = { | |
staging: 'staging-remote-name', | |
production: 'production-remote-name' | |
} | |
namespace :deploy do | |
# Create rake tasks to deploy on Heroku environments | |
# $ rake -T deploy | |
# rake deploy:production # Deploy to production |
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 Levenshtein | |
def initialize(str) | |
@str = str.downcase | |
end | |
def distance(str2) | |
distances = (0..str2.length.next).to_a | |
@str.each_char.with_index do |char, i| | |
distances[0] = i + 1 | |
sub_cost = i |
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 'aws-sdk' | |
require 'json' | |
module SQSW | |
class SQueue | |
MissingQueue = Class.new(StandardError) | |
def initialize(url = nil) | |
raise(MissingQueue, "Missing queue_url") if url.nil? | |
@q = find_queue(url) |
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
curl http://tachyon.vektra.io/install.sh > it.sh && test $(openssl sha1 < it.sh) = "23fb0450b152dfaa8331dd37c3a4c13d4de9dbb8" && bash it.sh |
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 'rubygems' | |
require 'rbosa' | |
account='xxx' | |
username='xxx' | |
password='xxx' | |
api="https://#{account}.presentlyapp.com/api/twitter/statuses/update.xml" | |
itunes = OSA.app("iTunes") |
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
# NewRelic instrumentation for ThinkingSphinx | |
if defined? ActiveRecord | |
ActiveRecord::Base.class_eval do | |
class << self | |
add_method_tracer :search, 'ActiveRecord/#{self.name}/search' | |
add_method_tracer :search, 'ActiveRecord/search', :push_scope => false | |
add_method_tracer :search, 'ActiveRecord/all', :push_scope => false | |
add_method_tracer :search_count, 'ActiveRecord/#{self.name}/search_count' | |
add_method_tracer :search_count, 'ActiveRecord/search_count', :push_scope => false |
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/ruby | |
require 'rubygems' | |
require 'tinder' | |
load "#{ENV['HOME']}/.campfire_status" | |
msg = "[#{USER_NAME} @ #{Time.now.strftime('%I:%M%p')}] #{ARGV.join(' ')}" | |
campfire = Tinder::Campfire.new(CAMPFIRE_SITE) | |
campfire.login(CAMPFIRE_EMAIL, CAMPFIRE_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
# on Start | |
do shell script "~/bin/set_campfire_status.rb \"Starting Pomodoro '$pomodoroName'\"" | |
# on End | |
do shell script "~/bin/set_campfire_status.rb \"Pomodoro '$pomodoroName' ended\"" | |
# on Reset | |
do shell script "~/bin/set_campfire_status.rb \"Pomodoro '$pomodoroName' ended (reset)\"" |
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
# install git | |
# install heroku ruby gem | |
# now, clone the github_twitter_server project | |
git clone git://github.com/technoweenie/github_twitter_server.git | |
cd github_twitter_server | |
# create a free heroku app | |
heroku create USER-gh-twitter |
OlderNewer