Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rjlee on github.
  • I am rjlee (https://keybase.io/rjlee) on keybase.
  • I have a public key ASCBmeDhx9HArAY6ZUZfrRXMrvnVUqWDYIbsJQJPEwA6xwo

To claim this, I am signing this object:

@rjlee
rjlee / test.rb
Last active December 26, 2015 11:49
IronMQ Test
require 'rubygems'
require 'iron_mq'
require 'pp'
messages = 5
# Create an IronMQ::Client object
@ironmq = IronMQ::Client.new()
# Clear down and create a queue
sqlite3 -separator ' ' ${COOKIES:-Cookies} \
'select host_key, "TRUE", path, "FALSE", expires_utc, name, value from cookies'
require 'rubygems'
require 'naive_bayes'
require 'twitter'
nb = NaiveBayes.load('nb.nb')
client = Twitter::HTTPAuth.new('reddavis', 'password')
connection = Twitter::Base.new(client)
tweets = []
Failure: return_to does not match return URL. Expected 'http://www.wildlifenearyou.com/account/complete/', got u'http://www.wildlifenearyou.com/account/complete/?next=&janrain_nonce=2010-01-12T23%3A47%3A08ZaAY9Sg&openid1_claimed_id=http%3A%2F%2Fid.REDACTED.com%2F'
development: &global_settings
database: textual_development
host: 127.0.0.1
port: 27017
test:
database: textual_test
<<: *global_settings
production:
# Adjust sessions so they work across subdomains
# This also will work if your app runs on different TLDs
# from: http://szeryf.wordpress.com/2008/01/21/cookie-handling-in-multi-domain-applications-in-ruby-on-rails/
# modified to work with Rails 2.3.0
module ActionControllerExtensions
def self.included(base)
base::Dispatcher.send :include, DispatcherExtensions
end
@rjlee
rjlee / oauth_authorise.rb
Created September 1, 2009 08:57
Command line oauth authorizer
#!/usr/bin/ruby
require 'rubygems'
require 'oauth'
require 'oauth/consumer'
site = ARGV[0]
consumer_token = ARGV[1]
consumer_secret = ARGV[2]
@rjlee
rjlee / google_muddy.rb
Created August 31, 2009 20:38
Google muddy indexer
#!/usr/bin/ruby
require 'rubygems'
require 'cgi'
require 'open-uri'
require 'hpricot'
require 'muddyit_fu'
# Search term for google
search = 'site:news.bbc.co.uk/1/hi/'
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats
def output_config
puts <<-END
graph_category App
graph_title Passenger memory stats
graph_vlabel count