This file contains hidden or 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
require 'rubygems' | |
require 'hubris' # best line ever | |
class Target | |
hubris :inline =>"triple::Int->Int; triple n = 3*n" | |
end |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 | |
This file contains hidden or 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
"the /data/nginx/servers/:application.rewrites for the customer's application file exists" =~ /^the ((?:\w+|\/|\.|-|~|:)+(?:for the \S+ application)?) file exists$/ |
This file contains hidden or 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
require 'rubygems' | |
require 'eventmachine' | |
require 'em-http' | |
require 'dataflow' | |
Thread.new { | |
EM.run{} | |
} | |
module EventMachine |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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" |
This file contains hidden or 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
(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))))) |