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
hi there | |
likewise |
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 File.expand_path(File.dirname(__FILE__) + "/../spec_helper") | |
require "activeresource" | |
require "active_resource/http_mock" | |
require "ruby-debug" | |
class RemotePerson < ActiveResource::Base | |
self.site = "http://localhost:3000" | |
self.element_name = "person" | |
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 | |
require "pp" | |
DICTIONARY_PATH = "/usr/share/dict/words" | |
if ARGV.empty? | |
puts "Usage: ruby t9-lookup.rb 12345 [max_length]" | |
exit 1 | |
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
class Tumblr | |
class << self | |
def email | |
credentials["email"] | |
end | |
def password | |
credentials["password"] | |
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 | |
require "rubygems" | |
require "eventmachine" | |
$search_terms = ARGV | |
if $search_terms.empty? | |
puts "Hey now, add some search terms for your buckets." | |
exit 1 | |
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
# | |
# Spit out a shortened working directory | |
# | |
# I tried out the fish shell (http://ridiculousfish.com/shell/) recently | |
# after it showed up on Hacker News, and the part I really liked was the | |
# shortened working directory on the prompt: | |
# | |
# dave@lew ~/w/g/transport> | |
# | |
# Here's a first cut at making it work for bash. |
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
# Accurate queue times for Heroku Cedar + Rails (or Rack) | |
# | |
# For Rails: | |
# | |
# Rails::Application.middleware.insert(0, QueueTimeLogger) | |
# | |
class QueueTimeLogger | |
attr_reader :app | |
def initialize(app, options = {}) |
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 "yajl" | |
GROUP_ID = ENV["GROUP_ID"] | |
TOKEN = ENV["TOKEN"] | |
file = File.open("Group-#{GROUP_ID}.txt", "w") | |
query_string = "" | |
results = [] | |
loop do |