Skip to content

Instantly share code, notes, and snippets.

<!--: spam
Content-Type: text/html
<body><font style="color: white; font-size: 1px"> -->
<body><font style="color: white; font-size: 1px"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>
<div class="cgitb">
<script type="text/javascript">
function toggleDebugInfo() {
#!/bin/sh
sudo mkdir -p /usr/local/hudson
sudo curl -k -L http://hudson.gotdns.com/latest/hudson.war -o /usr/local/hudson/hudson.war
gad:~ matt$ rvm jruby@culerity -e "puts 'hello world'"
info: jruby-1.5.1: jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [x86_64-java]
hello world
gad:~ matt$
gad:~ matt$ ruby -e "puts 'hello world'"
hello world
gad:~ matt$
$ cucumber # (culerity harness) ->
system "cucumber" # (culerity generated test app) ->
"rvm jruby@culerity ruby /path/to/script/to/start/celerity.rb" # eventual celerity invocation
@fidothe
fidothe / gist:894327
Created March 30, 2011 12:49
If you want to use gem pristine with RVM gemsets after ditching MacPorts for Homebrew to recompile native gems:
# If you want to use gem pristine with RVM gemsets after ditching MacPorts for Homebrew
# in order to recompile native gems you need to exclude things in the global gemset
# probably rake, bundler, maybe rdoc
gem list --no-versions | grep -v bundler | grep -v rake | xargs -n1 gem pristine
@fidothe
fidothe / bundle-all
Created May 3, 2011 10:28
run git pull / push / status in all child folders which are git repositories; run bundle install in all child folders which have Gemfiles
#!/bin/bash
for i in `find . -name Gemfile -depth 2 | xargs -n1 dirname`
do
pushd $i
bundle install
popd
done
@fidothe
fidothe / cookieblind.rb
Created May 4, 2011 13:54
Rack middleware to prevent cookies coming in or out except on POST
class Cookieblind
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
unless request.post?
env.delete("HTTP_COOKIE")
end
@fidothe
fidothe / cookieblind.rb
Created July 11, 2011 16:40
Stop getting confused by cookies by making your app cookie-blind
class Cookieblind
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
unless request.post?
env.delete("HTTP_COOKIE")
end
#!/bin/bash
gem install bundler
git clone git://github.com/fidothe/pub_finder_general.git
cd pub_finder_general
bundle install
@fidothe
fidothe / gist:1373175
Created November 17, 2011 13:50
Error running brew upgrade
Beor:web matt$ brew doctor
Your system is raring to brew.
Beor:web matt$ brew update
Initialized empty Git repository in /usr/local/.git/
remote: Counting objects: 48129, done.
remote: Compressing objects: 100% (21364/21364), done.
remote: Total 48129 (delta 30245), reused 41934 (delta 26093)
Receiving objects: 100% (48129/48129), 6.87 MiB | 1.00 MiB/s, done.
Resolving deltas: 100% (30245/30245), done.
From https://github.com/mxcl/homebrew