Skip to content

Instantly share code, notes, and snippets.

View therabidbanana's full-sized avatar
🌴
On vacation

David Haslem therabidbanana

🌴
On vacation
  • Pathstream
  • San Francisco
View GitHub Profile
// 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,
@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.
#!/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
#!/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
@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/"
@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"] = "therabidbanana@gmail.com"
run app
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;
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}"
@therabidbanana
therabidbanana / Gemfile
Created August 20, 2010 04:22
A simple sparkles app with blog
# Gemfile
source "http://rubygems.org"
gem "openid_dm_store", :git => "git://github.com/therabidbanana/openid_dm_store.git"
gem "orange-more", :git => "git://github.com/therabidbanana/orange-more.git"
gem "orange-core", :git => "git://github.com/therabidbanana/orange-core.git"
gem "orange-sparkles", :git => "git://github.com/orange-project/orange-sparkles.git"
gem "dm-postgres-adapter"
startshape banana;
rule banana{
apple{ s 1.5 hue 67 b .9 sat .7}
}
rule apple {
SQUARE { skew 1.2 .9 }
tree { }
apple { s .989 r 10 hue 12 }