Skip to content

Instantly share code, notes, and snippets.

View juliancheal's full-sized avatar

Julian Cheal juliancheal

View GitHub Profile
@juliancheal
juliancheal / gist:1041148
Created June 22, 2011 20:51
Trying to run @stef's Caboodle gem.
$ caboodle create myproject
(eval):2:in `method_missing': undefined method `expand_path' for nil:NilClass (NoMethodError)
from /Users/Username/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-sugar-0.5.1/lib/sinatra/sugar.rb:42:in `root_path'
from /Users/Username/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-compass-0.5.0/lib/sinatra/compass.rb:41:in `registered'
from /Users/Username/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1200:in `block in register'
from /Users/Username/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1198:in `each'
from /Users/Username/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1198:in `register'
from /Users/Username/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-sugar-0.5.1/lib/sinatra/sugar.rb:34:in `register'
from /Users/Username/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1460:in `register'
from /Users/Username/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1515:in `register'
@juliancheal
juliancheal / gist:1275440
Created October 10, 2011 14:22
Chiliproject rake db:migration
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== Setup: migrating ==========================================================
-- create_table("attachments", {:force=>true})
-> 0.0388s
-- create_table("auth_sources", {:force=>true})
-> 0.0454s
-- create_table("custom_fields", {:force=>true})
@juliancheal
juliancheal / gist:1843948
Created February 16, 2012 10:38
A Ruby poem for Dev8d 2012
class Roses
def self.colour(*)
end
end
class Violets
def self.colour(*)
end
end
@juliancheal
juliancheal / gist:1846007
Created February 16, 2012 16:02 — forked from jacksonj04/gist:1845849
HTML Limerick cos I'm cool
var limerick = (function() {
return "Y U NO RUBY"
})();
@juliancheal
juliancheal / dm-whisky-mapper.rb
Last active December 17, 2015 06:28
DM-Whisky-Mapper
# cd to dm-mapper's directory
# cd to lib
ruby_classes = []
ObjectSpace.each_object do |o|
ruby_classes << o if o.is_a?(Class)
end
require 'rake'
@juliancheal
juliancheal / I am not a hipster
Created July 3, 2013 23:32
I am not a hipster, but..
Text from http://jesseesspot.blogspot.co.uk/2012/02/how-to-tell-if-you-are-hipster.html
The typical hipster garb:
Horned rimmed glasses, preferably thick and black (I have brown plastic framed glasses and not really sure what horned rimmed ones are)
Old nostalgic pop-culture t-shirts, skinny jeans or leggings, vintage anything, plaid, flannel or cowboy shirts, chucks and skinny hoodies (I hate all those clothes except skinny cords.)
Crazy thick beards or weirdly styled mustaches, hairy girl legs and armpits (I have a mustache that I occationaly wax, but my beard isn't partically thick)
require 'artoo'
connection :firmata, :adaptor => :firmata, :port => '/dev/cu.usbmodem1411'
device :board, :driver => :device_info
device :relay_1, :driver => :relay, :invert => true, :pin => 7
device :relay_2, :driver => :relay, :invert => true, :pin => 8
work do
puts "Firmware name: #{board.firmware_name}"
@juliancheal
juliancheal / ruby-ldap-sample.rb
Last active August 29, 2015 14:26 — forked from jeffjohnson9046/ruby-ldap-sample.rb
Some VERY basic LDAP interaction in Ruby using Net::LDAP.
#######################################################################################################################
# This Gist is some crib notes/tests/practice/whatever for talking to Active Directory via LDAP. The (surprisingly
# helpful) documentation for Net::LDAP can be found here: http://net-ldap.rubyforge.org/Net/LDAP.html
#######################################################################################################################
require 'rubygems'
require 'net/ldap'
#######################################################################################################################
# HELPER/UTILITY METHOD

Keybase proof

I hereby claim:

  • I am juliancheal on github.
  • I am juliancheal (https://keybase.io/juliancheal) on keybase.
  • I have a public key whose fingerprint is 12DE 6570 C983 EF6A 7C32 48A3 ACA5 66E6 64E7 6270

To claim this, I am signing this object:

@juliancheal
juliancheal / README.md
Created March 13, 2016 23:28 — forked from xavriley/README.md
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip