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
# multiplication_table | |
STDOUT.sync = true | |
def multiplication_table n, msg = '', decorate = false | |
len = (n * n).to_s.length + 1 | |
head = decorate ? " #{'=' * len * n}\n" : '' | |
body = " #{msg}\n" << head << | |
(1..n).collect{|j| (1..n).collect{|i| "%#{len}s" % (i*j)}.join + "\n"}.join << | |
head << "\n" | |
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
require 'ostruct' | |
module RubyInstaller | |
module Version | |
unless defined?(MAJOR) | |
MAJOR = 3 | |
MINOR = 0 | |
REVISION = 0 | |
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
# This is a replay to Fela's question: | |
# http://gist.github.com/452089 | |
# | |
# Look at Shoes manual, The Rules of Shoes | |
# - Shoes Tricky Blocks | |
# - Block Redirection | |
# | |
# http://shoes.heroku.com/manual/Rules.html | |
# | |
# If you'd like to add all outputs of addparas into the flow slot you defined |
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
# A shoes script (www.shoooes.net) to split a Wordpress WXR file into | |
# smaller files for easier importing to Wordpress | |
# Copyright Cecil Coupe (2008) | |
# ccoupe@cableone.net | |
# Use it anyway you like. An email to author is appreciated. | |
# | |
# One could change all the @console.puts (str) to @console.contents << str+'\n' | |
# One could get really tired to doing that a lot of times. | |
Shoes::Para.class_eval do | |
def puts(str) |
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 '../lib/green_shoes' | |
DATA = %w{ place plan plant plot face race rails ruby train trouble double } | |
MSG = "Enter a search." | |
Shoes.app title: "Search sample", width: 300, height: 400 do | |
def search input | |
input.empty? ? [] : DATA.select{|w| w.include? input} | |
end | |
edit_line width: 300 do |el| |
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 '../lib/green_shoes' | |
class Kensho < Shoes | |
url '/', :index | |
url '/validate', :validate | |
def index | |
stack do | |
flow do | |
para "kensho" |
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
# | |
# Shoes Clock by Thomas Bell | |
# posted to the Shoes mailing list on 04 Dec 2007 | |
# Original code for Red Shoes is: https://github.com/shoes/shoes/blob/master/samples/good-clock.rb | |
# The following is a little bit modified for Green Shoes | |
# | |
require '../lib/green_shoes' | |
Shoes.app :height => 260, :width => 250 do |
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
# creatures.rb | |
class IndustrialRaverMonkey < Creature | |
life 46 | |
strength 5 | |
end | |
class DwarvenAngel < Creature | |
life 54 | |
strength 8 |
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
ashbb,shoes,010-223-3356,2011.3.11,Tokyo,Japan |
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 'green_shoes' | |
require_relative './orgaan' | |
include OrgaanGui | |
Shoes.app title:"Shu Ha Ri",width: 1280, height: 720 do | |
background khaki, height: 2000 | |
@m=[] | |
fwin1 = flow width: 0.5, height: 0.3 do | |
para "In onderstaande lijst kunt u een keuze maken |
OlderNewer