Skip to content

Instantly share code, notes, and snippets.

View larrytheliquid's full-sized avatar

Larry Diehl larrytheliquid

View GitHub Profile
require 'rubygems'
require 'hubris' # best line ever
class Target
hubris :inline =>"triple::Int->Int; triple n = 3*n"
end
# configure RubyGems to install into Homebrew's cellar
echo export GEM_HOME="$(brew --prefix)/Cellar/Gems/1.8" >> ~/.bash_profile
echo export GEM_PATH="$(brew --prefix)/Cellar/Gems/1.8:/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby/gems/1.8/gems" >> ~/.bash_profile
# configure RubyGems so it pings homebrew to update bin symlinks
gem install brewbygems
laptoptheliquid:~ larry$ brew install ghc
Error: RubyCocoa could not be loaded, therefore checking for spill is disabled.
When using a custom Ruby installation, you'll need to install RubyCocoa.
If this is not the case, see if the following ticket applies, or create one.
http://github.com/mxcl/homebrew/issues#issue/37
Warning: You should upgrade to Xcode 3.1.4
Warning: It appears you have Macports or Fink installed
Although, unlikely, this can break builds or cause obscure runtime issues.
If you experience problems try uninstalling these tools.
==> Downloading http://www.haskell.org/ghc/dist/current/dist/ghc-6.13.20100108-src.tar.bz2
@larrytheliquid
larrytheliquid / env.rb
Created September 23, 2009 03:56
Reply to Cucumber Transform comment http://is.gd/3AqhI
def self.TokenTransform(token, pattern, &transform)
unless Kernel.const_defined? token
class << val = []
def to_s
"(#{Regexp.union(*self)})"
end
end
Kernel.const_set token, val
end
Scenario Outline: filesystem setup
Then the <path> <type> exists
And the owner of <path> is the <user> user
And the group of <path> is the group of the <user> user
And the permissions for <path> are <permissions>
Scenarios: configuration
| type | permissions | user | path |
| file | 0644 | customer's | /data/nginx/nginx.conf |
| directory | 0775 | customer's | /data/nginx/ssl |
"the /data/nginx/servers/:application.rewrites for the customer's application file exists" =~ /^the ((?:\w+|\/|\.|-|~|:)+(?:for the \S+ application)?) file exists$/
require 'rubygems'
require 'eventmachine'
require 'em-http'
require 'dataflow'
Thread.new {
EM.run{}
}
module EventMachine
# tail.rb
# JAVA_OPTS="-Djruby.tailcall.enabled=true" jruby tail.rb --1.9
# Error: Your application used more stack memory than the safety cap of 1024k.
# Specify -J-Xss####k to increase it (#### = cap size in KB).
# Specify -w for full StackOverflowError stack trace
def fact(n, acc)
if n == 0
acc
else
require "rubygems"
require "rack/client"
require "rack/contrib"
puts "PUT'ing /store/fruit (with strawberry)"
puts
Rack::Client.put "http://localhost:9292/store/fruit", "strawberry"
puts "GET'ing /store/fruit"
(share-test "non-empty specjure.examples/stack" []
(test "is not empty"
(is (not (empty? ($get :stack)))))
(test "returns the top item when applied to specjure.examples/peek"
(is (= ($get :last-item-added) (peek ($get :stack)))))
(test "does not remove the top item when applied to specjure.examples/peek"
(is (= ($get :last-item-added) (peek ($get :stack))))
(is (= ($get :last-item-added) (peek ($get :stack)))))