Skip to content

Instantly share code, notes, and snippets.

(1 < 10)
ifTrue: [ Transcript show: 'sanity reigns' ]
ifFalse: [Transcript show: 'not all is right with the world']
|spaceTallyPath|
spaceTallyPath := FileDirectory default fullPathFor: 'STSpace.text'.
aMenu addLine.
aMenu add: 'SpaceTally [', spaceTallyPath, ']' translated
target: SpaceTally new
action: #printSpaceAnalysis.
aMenu add: 'Empty Trash Can' translated
target: Utilities
action: #emptyScrapsBook.
aMenu add: 'Clear Command History'
function monthsBetween(thisDate, thatDate) {
if (thisDate > thatDate) {
return monthsBetween(thatDate, thisDate);
}
var number = 0;
if (thatDate.getFullYear() > thisDate.getFullYear()) {
number = number + (thatDate.getFullYear() - thisDate.getFullYear() - 1) * 12;
} else {
return thatDate.getMonth() - thisDate.getMonth();
Getting the Gist of things:
<script src="http://gist.github.com/1.js"></script>
%w{framing opera outline pretty print s5-core slides}.each do |style|
get "/ui/#{style}.css" do
response['Content-Type'] = 'text/css; charset=utf-8'
sass style.to_sym
end
end
get '/hello/?' do
"Hello, World!"
end
get '/hello/:name' do
"Hello, #{ params['name'] }!"
end
get %r{/(hello|hi)/:name} do
"#{ params[:captures][1] }, #{ params['name'] }!"
end
get '/sqrt/:num.:format' do
model = Math.sqrt(params[:num].to_f)
content_type params[:format].to_sym
format(model, params, self)
end
def format(model, params, app)
if %w{xml json pdf xls csv html}.include? params[:format]
app.send(params[:format], model)
else
jrogers@rasta:~/sequel_raggi$ rake spec_oracle
(in /home/jrogers/sequel_raggi)
...Sequel::Dataset#uniq is deprecated and will be removed in a future version. Use Sequel::Dataset#distinct.
./spec/adapters/../../lib/sequel/deprecated.rb:193:in `uniq'
./spec/adapters/oracle_spec.rb:89
/var/lib/gems/1.8/gems/rspec-1.1.12/lib/spec/example/example_methods.rb:114:in `instance_eval'
/var/lib/gems/1.8/gems/rspec-1.1.12/lib/spec/example/example_methods.rb:114:in `eval_block'
/var/lib/gems/1.8/gems/rspec-1.1.12/lib/spec/example/example_methods.rb:52:in `execute'
/usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
/var/lib/gems/1.8/gems/rspec-1.1.12/lib/spec/example/example_methods.rb:49:in `execute'