Skip to content

Instantly share code, notes, and snippets.

@adamjonas
adamjonas / blane_final
Created July 9, 2012 17:45
Missing Pieces of Blane's Final
class Artist
def genres
@songs.collect{|s| s.genre}
end
end
class Song
attr_accessor :name, :song, :artist, :genre
def genre=(genre)
@adamjonas
adamjonas / Quiz 1
Created October 9, 2012 02:11
assignment1
# Write a program that tells you the following:
#
# Hours in a year. How many hours are in a year? - 6pts
# Minutes in a decade. How many minutes are in a decade? - 6pts
# Your age in seconds. How many seconds old are you? - 6pts
#
# Define at least the following methods to accomplish these tasks:
#
# seconds_in_minutes(1) #=> 60 - 3pts
# minutes_in_hours(1) #=> 60 - 3pts
@adamjonas
adamjonas / FizzBuzz.rb
Created October 9, 2012 02:12
FizzBuzz
# Define the fizzbuzz method to do the following: 10pts
# Use the modulo % method (divisible by)
# 2 % 2 #=> true
# 1 % 2 #=> false
# If a number is divisible by 3, puts "Fizz".
# If a number is divisible by 5, puts "Buzz".
# If a number is divisible by 3 and 5, puts "FizzBuzz"
# Use if statements 2pts
@adamjonas
adamjonas / assignment.rb
Created October 12, 2012 03:04
Friday Oct 12
# Assignment
# write a true expression using ==
a == a
# write a false expression using ==
a == b
# write a true expression using !=
true != false
# write a false expression using !=
@adamjonas
adamjonas / jukebox.rb
Created October 15, 2012 13:28
Jukebox
puts "What do you want me to do? (Remember to type 'help' if you need it!)"
prompt = '> '
print prompt
input = gets.chomp.downcase.strip
puts "Sure... no problem"
# songs = [
# "The Magnetic Fields - 69 Love Songs - Parades Go By",
# "The Magnetic Fields - Get Lost - Smoke and Mirrors",
# "The Magnetic Fields - Get Lost - You, Me, and the Moon",
def test(title, &b)
begin
if b
result = b.call
if result.is_a?(Array)
puts "fail: #{title}"
puts " expected #{result.first} to equal #{result.last}"
elsif result
puts "pass: #{title}"
else
@adamjonas
adamjonas / Pergola
Last active December 24, 2015 02:29
Pergola
###cURL
#Authenticate
curl -X POST --data 'username=adam.jonas@carrotcreative.com&password=1password' https://api.vineapp.com/users/authenticate
#My profile
curl -H "vine-session-id:#{key}" https://api.vineapp.com/users/me
###httparty
gem install httparty

order: 3 question: 'How does it work?' answer: 'There are two ways to participate:

DEVELOPMENT

Online submission of innovative, feasible concepts to the DEVELOPMENT track. Proposals will be judged on technical and business criteria (listed in the Judging section below). As participants advance to semi-final and final rounds, they will receive mentorship, education, and resources to help optimize the potential of their ideas. Winners will receive up to $500,000 in funding, gain business development support to launch their products, and attend the MAKE IT WEARABLE final presentation and gala event. If a winning submission is made by a team or organization, prizes will be awarded to the team or organization as a whole (not on an individual basis).

VISIONARY

@adamjonas
adamjonas / gist:8965462
Created February 12, 2014 22:03
gem file
source 'https://rubygems.org'
# Frameworks
gem 'rails', '4.0.2'
# Server
gem 'unicorn'
# Database
gem 'pg'
`curl -o tmp/latest.dump \`heroku pgbackups:url -a fis-ironboard-production\``