Skip to content

Instantly share code, notes, and snippets.

View therabidbanana's full-sized avatar

David Haslem therabidbanana

  • Pathstream
  • San Francisco
View GitHub Profile
require 'rubygems'
require 'flickraw-cached'
FlickRaw.api_key="... API KEY HERE ..."
FlickRaw.shared_secret="... Shared Secret ..."
frob = flickr.auth.getFrob
auth_url = FlickRaw.auth_url :frob => frob, :perms => 'read'
puts "Open this url in your process to complete the authication process : #{auth_url}"
DROP TABLE IF EXISTS `pages`;
CREATE TABLE `pages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`content` text,
PRIMARY KEY (`id`),
UNIQUE KEY `titleu` (`title`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
@therabidbanana
therabidbanana / config.ru
Created July 8, 2010 04:14
(Nearly) Smallest possible orange-sparkles site
#-s thin -p 5432
require "rubygems"
require 'orange-sparkles'
app = Orange::SparklesApp.app
app.orange.options["main_user"] = "[email protected]"
run app
@therabidbanana
therabidbanana / get-review-url.rb
Created July 5, 2010 15:24
A script to copy dropbox review urls to clipboard
#!/usr/bin/env ruby
# dont change anything below, unless you know what are you doing
require 'fileutils'
require 'cgi'
require 'base64'
class DropboxThingy
DROPBOX_URL="http://review.orangesparkleball.com/"
#!/usr/bin/env python
# encoding: utf=8
from pyechonest import config
config.ECHO_NEST_API_KEY=""
import echonest.audio as audio
from echonest.selection import fall_on_the
from echonest.sorting import duration
#!/usr/bin/env ruby
# After two hours of reading the Daily WTF, I
# thought it was time to write some code.
#
# Can you guess what it does?
class Bool
attr_accessor :attr4
def self.true
@therabidbanana
therabidbanana / hello_world.rb
Created June 15, 2010 04:57
An extremely convoluted hello world
#!/usr/bin/env ruby
require 'yaml'
# Prints out the string "Hello World!" in
# an extremely convoluted way involving
# method_missing magic, dynamic method calls,
# some metaprogramming, completely useless comments,
# the DATA block, yaml, and Sesame Street.
#
# This hello world brought to you by the letter Q.
// This tells the awesome rule to execute on start
startshape awesome
rule awesome{
// Call the shape1 rule
shape1 { hue 220 b .6 sat .8}
// When telling itself to run again,
// the awesome rule rotates itself 13 degrees,