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/sh | |
#set -o xtrace | |
#set -o verbose | |
#set -o errexit | |
#set -o errtrace | |
latest_url="https://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/latest" | |
latest=$(curl -s "$latest_url") | |
echo "Latest build is $latest" |
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
package foo; | |
public interface Greeter { | |
String greet(); | |
String greet(String name); | |
String defaultGreeting(); | |
} |
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
/.divshot-cache |
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
$ grails create-app grails-blog | |
$ cd grails-blog | |
$ grails install-plugin simple-blog | |
$ cat >> grails-app/conf/Config.groovy | |
> grails.blog.author.evaluator = { request.remoteAddr } | |
> ^D | |
$ mkdir -p grails-app/domain/demo/blog/ | |
$ cat > grails-app/domain/demo/blog/Commenter.groovy | |
> package demo.blog | |
> |
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
require 'rubygems' | |
require 'expectations' | |
Expectations do | |
expect(1){ proc{ |a| a }.call(1) } | |
expect([1, 2]){ proc{ |a| a }.call(1, 2) } | |
expect(1){ proc{ |a, b| a }.call(1, 2) } | |
expect(1){ Proc.new{ |a| a }.call(1) } |
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 | |
/export/groups/nagios/libexec/check_http -f follow -H $1 -u /trainline -a tlsvn:\!4321abcd -r `/usr/bin/curl -u tlsvn:\!4321abcd -L http://bngsvn01.thoughtworks.co/trainline 2> /dev/null | /bin/sed -ne "/title.*Revision/ { s/.*trainline -Revision \([0-9]\+\):.*/\1/ ; p}"` |
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
def f = new Foo('hello') | |
assert f.bar() == 'original hello' | |
use(FooCategory) { assert f.bar() == 'categorical hello' } | |
class Baz { | |
def quux(boo) { new Foo(boo).bar() } | |
} |
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
foo = lambda { |x| puts x } | |
foo.call('Hello, World!') | |
foo['You can index me too!'] |
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
({ it('ABCD') }) { "${it} and some more" } //=> 'ABCD and some more' |
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 BooleanCategory { | |
public static Boolean then(Boolean self, Closure c) { | |
if(self) c() | |
return self | |
} | |
public static Boolean otherwise(Boolean self, Closure c) { | |
if(!self) c() | |
return self |
OlderNewer