Skip to content

Instantly share code, notes, and snippets.

View johana-star's full-sized avatar
🕶️

Johana Star johana-star

🕶️
View GitHub Profile
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

What's the name of your app?

Household Gizmo

Fitgrapher (just developed this for fun on Sunday, but also demonstrates competency in Rails)

What does it do?

Household Gizmo is a house communication and expense calculation app.

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")}\"!"

What's the name (or codename) of your app? What will your app do?

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

@johana-star
johana-star / gist:5062975
Last active December 14, 2015 09:09 — forked from southpolesteve/gist:5060497
I tried to simplify this, but man, I don't know if I can crush down these conditionals and enumerables.
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
@johana-star
johana-star / tomato.rb
Last active October 5, 2015 08:08 — forked from mathias/tomato.rb
SassyTomato Timer (for pomodoros)
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