- Programming Ruby (aka, The Pickaxe)
- The Well Grounded Rubyist
- _why's Poignant Guide _ a little scattershot, mad
- Learn to Program - designed for newcomers with no programming experience
require "active_support/all" | |
def format_date_range(from, to = false) | |
to = from if to.blank? | |
return '' if from.nil? && to.nil? | |
from, to = [to, from].sort | |
if from == to | |
month_day_year(from) | |
elsif from.year == to.year |
begin | |
p @user_input.nil? ? 'Your phrase here please:' : "That wasn't a phrase! Try again." | |
@user_input = gets.strip | |
end while @user_input == "" | |
print "Daffy says \"#{@user_input.gsub!(/S/, "Th").gsub!(/s/, "th")}\"!" |
I'm not sure that I want to work on a single app. Current project ideas include:
Kitten of the day! - an app which takes email addresses and sends the compiled list a photo of a kitten every morning.
Background processing - evaluating a collection of data to see if it meets requirements, and recording which combinations meet requirements. A little background: last quarter Cheri and I worked on Slacker Meals, which generated a meal from a database of ingredients. Meals needed to be within certain ranges for protein, calcium, and calories. The naive method we used to generate meals randomly tried ingredients until it found a match. This usually took around a hundred tries. Instead, I would like to take a database, generate possible combinations, and evaluate the combos based on requirements.
When the database changes new combinations which include new ingredients should be evaluated... If the requirements change, the entire d
namespace :cleaner do | |
task :find do | |
models = Dir.glob("app/models/**/*") | |
methods = %w[] | |
models.each do |model| | |
if File.file?(model) | |
File.open(model).lines.each do |line| | |
if method = method_name? line |
Shoes.app :height => 215, :width => 215, :title => "SassyTomato" do | |
background pink | |
@time_to_start = Time.new | |
@stopped = true | |
def timer_button(args) | |
button args[:name] do | |
@time_to_stop = Time.now + args[:minutes] * 60 + 0.05 | |
run |