Skip to content

Instantly share code, notes, and snippets.

View deadprogram's full-sized avatar
💭
Currently available for work. Let's talk!

Ron Evans deadprogram

💭
Currently available for work. Let's talk!
View GitHub Profile
@deadprogram
deadprogram / forth.rb
Created January 15, 2012 20:02 — forked from krainboltgreene/forth.rb
Forth interpreter in 64 lines of Ruby
#!/usr/bin/env ruby
def pop; $stack.pop || raise(StackUnderflow); end
def push(expression); $stack << expression; end
def unary; -> { push(yield pop) }; end
def binary; -> { push(yield pop, pop) }; end
def unary_boolean; -> { push(if yield pop then 1 else 0 end) }; end
def binary_boolean; -> { push(if yield pop, pop then 1 else 0 end) }; end
def swap; $stack[-2,2] = $stack[-2,2].reverse; end
$stack = []
@deadprogram
deadprogram / gist:1870245
Created February 20, 2012 17:42
KidsCodeCamp Sample Event Description
We Want YOU For KidsCodeCamp!
Did you ever want to make a videogame, program a robot, or create a web site? Now you can!
Come to KidsCodeCamp, a free one-day event to learn how to use computers and technology to make things that do whatever you want.
KidsCodeCamp in PLACE will take place on DATE at YYY location from START TIME to END TIME.
Here is how it works:
1. Local volunteers will run classes intended for a particular age group (elementary, middle, or high-school age kids). Each class is from 1 to 2 hours long.
$ bundle install
Using rake (0.8.7)
Using chunky_png (1.2.5)
Using fssm (0.2.7)
Using sass (3.1.12)
Using compass (0.11.5)
Using ffi (1.0.10)
Using thor (0.14.6)
Using guard (0.8.7)
Using guard-shell (0.1.1)
class WishList
include Enumerable
attr_accessor :wishes
def initialize
@wishes=[]
end
def each &block
@wishes.each_with_index {|item, index| block.call("#{index}, #{item}")}
$ rake gitnesse:info
/Users/ron/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:30: warning: already initialized constant RAKEVERSION
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
/Users/ron/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:402: warning: already initialized constant EMPTY_TASK_ARGS
/Users/ron/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:450: warning: already initialized constant EMPTY
/Users/ron/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:962: warning: already initialized constant RUBY
/Users/ron/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:1031: warning: already initialized constant LN_SUPPORTED
/Users/ron/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:1240: warning: already initialized constant ARRAY_METHODS
/Users/ron/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rake.rb:1243: warning: already initialized constant MUST_DEFINE

ATT OAuth2 Clojure Client

Example of accessing ATT OAuth in Clojure using noir.

Usage

lein deps
CLIENT_ID=XXX CLIENT_SECRET=YYY AUTH_SERVER=xyz.com lein run
/usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:251:in `exist?': Insecure operation - exist? (SecurityError)
from /usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:251:in `load_file'
from /usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:190:in `initialize'
from /usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:78:in `new'
from /usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:78:in `do_configuration'
from /usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:51:in `run'
from /usr/local/kidsruby/ruby/bin/gem:30:in `<main>'
/usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:251:in `exist?': Insecure operation - exist? (SecurityError)
from /usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:251:in `load_file'
from /usr/local/kidsruby/ruby/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:190:in `initialize'
Installing gems...
/Users/ron/Developer/kidsrubyinstaller-osx/build/KidsRubyInstaller.app/Contents/Resources/script: line 112: /Applications/KidsRuby/KidsRuby.app/core/ruby/bin/gem: No such file or directory
/Users/ron/Developer/kidsrubyinstaller-osx/build/KidsRubyInstaller.app/Contents/Resources/script: line 113: /Applications/KidsRuby/KidsRuby.app/core/ruby/bin/gem: No such file or directory
/Users/ron/Developer/kidsrubyinstaller-osx/build/KidsRubyInstaller.app/Contents/Resources/script: line 114: /Applications/KidsRuby/KidsRuby.app/core/ruby/bin/gem: No such file or directory
/Users/ron/Developer/kidsrubyinstaller-osx/build/KidsRubyInstaller.app/Contents/Resources/script: line 115: /Applications/KidsRuby/KidsRuby.app/core/ruby/bin/gem: No such file or directory
Installing qtbindings gem...
/Users/ron/Developer/kidsrubyinstaller-osx/build/KidsRubyInstaller.app/Contents/Resources/script: line 120: /Applications/KidsRuby/KidsRuby.app/core/ruby/bin/gem: No such file or directory
Installing gosu gem..
/Users/ro
Installing gems...
/usr/local/kidsruby/ruby/lib/ruby/1.9.1/rubygems/config_file.rb:217:in `exists?': Insecure operation - exists? (SecurityError)
from /usr/local/kidsruby/ruby/lib/ruby/1.9.1/rubygems/config_file.rb:217:in `load_file'
from /usr/local/kidsruby/ruby/lib/ruby/1.9.1/rubygems/config_file.rb:164:in `initialize'
from /usr/local/kidsruby/ruby/lib/ruby/1.9.1/rubygems/gem_runner.rb:71:in `new'
from /usr/local/kidsruby/ruby/lib/ruby/1.9.1/rubygems/gem_runner.rb:71:in `do_configuration'
from /usr/local/kidsruby/ruby/lib/ruby/1.9.1/rubygems/gem_runner.rb:44:in `run'
from /Applications/KidsRuby/KidsRuby.app/core/ruby/bin/gem:30:in `<main>'
/usr/local/kidsruby/ruby/lib/ruby/1.9.1/rubygems/config_file.rb:217:in `exists?': Insecure operation - exists? (SecurityError)
from /usr/local/kidsruby/ruby/lib/ruby/1.9.1/rubygems/config_file.rb:217:in `load_file'
Building serialport gem...
cd tmp/universal.x86_64-darwin10.8.0/serialport/1.9.2
make
gcc -I. -I/usr/local/kidsruby/ruby/include/ruby-1.9.1/universal-darwin10.8.0 -I/usr/local/kidsruby/ruby/include/ruby-1.9.1/ruby/backward -I/usr/local/kidsruby/ruby/include/ruby-1.9.1 -I../../../../ext/native -DHAVE_TERMIOS_H -DHAVE_UNISTD_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch i386 -arch x86_64 -fno-common -pipe -DOS_DARWIN -arch i386 -arch x86_64 -o posix_serialport_impl.o -c ../../../../ext/native/posix_serialport_impl.c
In file included from /usr/local/kidsruby/ruby/include/ruby-1.9.1/ruby.h:32,
from ../../../../ext/native/serialport.h:26,
from ../../../../ext/native/posix_serialport_impl.c:20:
/usr/local/kidsruby/ruby/include/ruby-1.9.1/ruby/ruby.h:50:21: error: stdlib.h: No such file or directory
/usr/local/kidsruby/ruby/include/ruby-1.9.1/ruby/ruby.h:54:21: error: string.h: No such file or directory
/u