Skip to content

Instantly share code, notes, and snippets.

Shoes.app :width => 200, :height => 200, :resizable => false do
@slot = flow :width => 100, :height => 100 do
@b = background rgb(255, 255, 0)
animate(24) do |i|
@b.remove
@slot.prepend { @b = background rgb(i,i,0) }
# or ... @b.rgb(i,i,0) ... to avoid creating new background objects?
end
end
end
Shoes.app do
@s0 = stack do
background red
100.times do
para "yay"
end
end
@s = stack do
style(:attach => Window, :top => height - 100)
background lightblue
Shoes.app(:width => 200, :height => 70 * 4 + 40) do
background black
colors = [red, blue, green, yellow]
people = ["steve","ed","nick","tom"]
@next_color = colors.cycle
@next_color.next
@previous_color = colors.cycle
(colors.length - 1).times { @previous_color.next }
@toothrot
toothrot / gist:80129
Created March 16, 2009 22:20
#try to name the colors of the words!
#try to name the colors of the words!
Shoes.app do
colors = ['red','green','blue','yellow','purple']
@box = stack
every(5) do
@box.clear
5.times do
this = colors[rand(colors.length)]
other = (colors - [this])[rand(colors.length - 1)]
@box.append do
#main.rb:
require 'helper'
Shoes.app do
extend Helper
@stack = stack do
para 'I am the first!'
end
helper_method(@stack,10)
end
locations = {
:name1 => "\\\\192.168.2.101\\e$\\gw.log",
:name2 => "\\\\192.168.2.101\\e$\\cima.log",
:name3 => "\\\\is-util02\\c$\\eba.log",
:name4 => "\\\\192.168.2.30\\c$\\DATA\\USERCOPYLOG.LOG",
:name5 => "\\\\192.168.2.30\\c$\\DATA\\PSTS.LOG",
:name6 => "\\\\192.168.2.105\\c$\\Program Files\\Windows Resource Kits\\Tools\\RC.log",
:name7 => "\\\\192.168.2.105\\c$\\Program Files\\Windows Resource Kits\\Tools\\RC2.log",
:name8 => "\\\\192.168.100.96\\f$\\QBROBOCOPY.LOG",
:name9 => "\\\\192.168.2.114\\c$\\RC2.LOG",
#!/home/arakoczy/local/bin/ruby
require 'rubygems'
require 'cgi'
require 'open-uri'
require 'hpricot'
query = CGI.escape(ARGV.shift)
puts (Hpricot(open("http://google.com/search?q=#{query}"))%('.r b')).innerHTML
@toothrot
toothrot / index.txt
Created November 30, 2009 20:21 — forked from mmcgrana/index.txt
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
#!/usr/bin/env ruby
require 'rubygems'
require 'growl'
require 'lighthouse/console'
Lighthouse.account = "thepoint"
Lighthouse.token = raise("Get your own key")
proj_id = "13151-support"
irb(main):039:0* require 'zendesk-api'
MissingSourceFile: no such file to load -- curb
from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from /Users/alexrakoczy/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/ge