Discover gists
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
@app = Shoes.app do | |
img0 = ask_open_file #select a first image in sequence. | |
NUM_IMGS = 5 | |
imgs = [] | |
NUM_IMGS.times do |n| | |
imgs << img0.sub(/\d+/) { |m| n } | |
end | |
background black |
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 PedAssignOptions < Struct.new(:links_file, :access_file, :walk_int_file, :output_file); end | |
class ParseFail < Struct.new(:reason); end | |
class ArgvParser | |
def parse argv | |
if argv.size == 1 and ['-h','--help'].include? argv.first then | |
return :help | |
end | |
if argv.length != PedAssignOptions.members.size then | |
return ParseFail.new("Incorrect number of arguments, got #{argv.size} expected #{PedAssignOptions.members.size}") |
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 proclol arg | |
{ | |
'a' => proc { true }, | |
'b' => proc { do_something }, | |
'c' => proc { your_money || your_fase } | |
}[arg] | |
end | |
proclol('b').call |
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 | |
BASEDIR=`dirname $0` | |
JAVA_OPTS="-Xmx2048m -Xms2048m -Xmn512m -server" | |
MAIN="start" | |
CP=$BASEDIR/../lib/jruby.jar:$BASEDIR/../lib/jgrapht-jdk1.5.jar:$BASEDIR/../lib/ped-assign.jar | |
java -cp $CP $JAVA_OPTS $MAIN $* |
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
helpers do | |
def h(s) | |
Rack::Utils.escape_html(s) | |
end | |
end |
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
helpers do | |
include Rack::Utils | |
alias_method :h, :escape_html | |
end |
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
// ==UserScript== | |
// @name gist.user.js | |
// @namespace http://github.com/hotchpotch | |
// @description install greasemonkey (user.js) | |
// @include http://gist.github.com/* | |
// @include https://gist.github.com/* | |
// ==/UserScript== | |
(function() { | |
$X('id("files")//div[@class="info"]/span').forEach(function(e) { |
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
[Wed Jul 23 - 18:30:06] [elliottcable @ Bishop] [~/Code/rat/] | |
-- git-rebase --interactive | |
[Wed Jul 23 - 18:30:10] [elliottcable @ Bishop] [~/Code/rat/] | |
-- |
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
test |
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
test2 |