View hman.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Formats a man page for reading in a browser, and opens it. Example: | |
# | |
# hman xsltproc | |
# | |
stylesheet=$(cat <<eocss | |
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="html" encoding="UTF-8" indent="yes"/> |
View protocols.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Module | |
def protocol(proto_name) | |
@current_protocol = proto_name.to_sym | |
end | |
def protocols | |
@protocols ||= Hash.new{|h,k| h[k] = []} | |
end | |
def method_added(name) |
View gist:851549
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total 8 | |
drwxr-xr-x 43 gabriel wheel 1462 Feb 24 23:01 Cellar | |
drwxr-xr-x 6 gabriel wheel 204 Aug 8 2010 Library | |
-rw-r--r-- 1 gabriel wheel 1613 Nov 4 22:54 README.md | |
drwxr-xr-x 364 gabriel wheel 12376 Feb 24 23:01 bin | |
drwxr-xr-x 11 gabriel wheel 374 Feb 15 22:46 etc | |
drwxr-xr-x 45 gabriel wheel 1530 Nov 4 23:03 include | |
drwxr-xr-x 219 gabriel wheel 7446 Feb 15 22:46 lib | |
drwxrwxr-x 11 gabriel wheel 374 Oct 6 19:24 libexec | |
drwxrwxr-x 7 gabriel wheel 238 Oct 12 11:37 sbin |
View gist:294235
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Class | |
def seal! | |
class_eval do | |
def self.method_added(method_name) | |
Object.const_set(name, @sealed) if defined?(@sealed) | |
end | |
def self.singleton_method_added(method_name) | |
Object.const_set(name, @sealed) if defined?(@sealed) |
View Rakefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tricksy | |
def self.lulz | |
puts "denied" | |
end | |
def self.singleton_method_added(name) | |
Object.const_set(:Tricksy, RealTricksy) if defined?(RealTricksy) | |
end | |
RealTricksy = self.clone |
View gist:257284
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/riot/context.rb b/lib/riot/context.rb | |
index 8532ccd..324f395 100644 | |
--- a/lib/riot/context.rb | |
+++ b/lib/riot/context.rb | |
@@ -1,5 +1,10 @@ | |
module Riot | |
- RootContext = Struct.new(:setups, :teardowns) | |
+ RootContext = Struct.new(:setups, :teardowns) do | |
+ def assertion_class | |
+ Assertion |
View gist:257256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/riot/context.rb b/lib/riot/context.rb | |
index a1231d7..8532ccd 100644 | |
--- a/lib/riot/context.rb | |
+++ b/lib/riot/context.rb | |
@@ -20,7 +20,7 @@ module Riot | |
def asserts_topic; asserts("topic") { topic }; end | |
def context(description, &definition) | |
- @contexts << Context.new("#{@description} #{description}", self, &definition) | |
+ @contexts << self.class.new("#{@description} #{description}", self, &definition) |
View gist:242067
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echoplex:rhino-test gabriel$ javagem install js | |
Successfully installed js-1.7.2 | |
1 gem installed | |
Installing ri documentation for js-1.7.2... | |
Installing RDoc documentation for js-1.7.2... | |
echoplex:rhino-test gabriel$ echo "gem 'js'" > Gemfile | |
echoplex:rhino-test gabriel$ jam org.mozilla.javascript.tools.shell.Main | |
Rhino 1.7 release 2 2009 03 22 | |
js> |
View gist:239216
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gabriels-vmware-virtual-platform:~ gabriel$ sudo gem update --system | |
Updating RubyGems... | |
ERROR: While executing gem ... (Gem::RemoteSourceException) | |
HTTP Response 403 fetching http://gems.rubyforge.org/yaml | |
gabriels-vmware-virtual-platform:~ gabriel$ |
View gist:237420
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echoplex:clojure-with-contrib-hello-world gabriel$ ls | |
Gemfile README.markdown | |
echoplex:clojure-with-contrib-hello-world gabriel$ cat Gemfile | |
gem "clojure-contrib" | |
echoplex:clojure-with-contrib-hello-world gabriel$ java -cp `javagem classpath` clojure.main -e '(println "hello, world")' | |
hello, world | |
echoplex:clojure-with-contrib-hello-world gabriel$ javagem classpath | |
/Users/gabriel/.javagem/java/gems/clojure-1.0.0/lib:/Users/gabriel/.javagem/java/gems/clojure-contrib-0.1.1/lib | |
echoplex:clojure-with-contrib-hello-world gabriel$ |
NewerOlder