Skip to content

Instantly share code, notes, and snippets.

As a subscriber,
I want to read full articles
so I can stay informed.
As a subscriber,
I want to be able to unsubscribe
so I can have control over my money.
As a subscriber,
I want to easily access articles
[mike:~/GDrive/rails_projects/atsalarm] master(+18/-3)* ± cd ~
[mike:~] $ clear
[mike:~] $ echo hello
hello
[mike:~] $ ls
Desktop Downloads GDrive Movies Pictures VirtualBox VMs dotfiles
Documents Dropbox Library Music Public another test gist.txt dotfiles_old
[mike:~] $ ls -l
total 8
drwx------+ 5 mike staff 170 Apr 26 21:13 Desktop
[mike:~/GDrive/rails_projects/atsalarm] master ± cd ~
[mike:~] $ clear
[mike:~] $ mkdir Documents/challenge_app
[mike:~] $ cd Do
Documents/ Downloads/ dotfiles/ dotfiles_old/
[mike:~] $ cd Documents/challenge_app/
[mike:~/Documents/challenge_app] $ git init
Initialized empty Git repository in /Users/mike/Documents/challenge_app/.git/
[mike:~/Documents/challenge_app] $ rails new challenge_1
create
[mike:~/GDrive/rails_projects/atsalarm] master ± cd ~
[mike:~] $ clear
[mike:~] $ mkdir Documents/challenge_app
[mike:~] $ cd Do
Documents/ Downloads/ dotfiles/ dotfiles_old/
[mike:~] $ cd Documents/challenge_app/
[mike:~/Documents/challenge_app] $ git init
Initialized empty Git repository in /Users/mike/Documents/challenge_app/.git/
[mike:~/Documents/challenge_app] $ rails new challenge_1
create
QUESTION_ANSWERS_DEFAULT = [
['What is your name?','Arthur'],
['What is your quest?', 'The Holy Grail'],
['What is the airspeed velocity of an unladen swallow?', 'African or European?']
]
FILE_PATH = 'question_answer.txt'
def load_question_answers(file)
lines = []
def query_question_answers
question_answers = []
i = 1
begin
puts "Please enter a question"
question = gets.chomp
puts "Please enter the answer"
answer = gets.chomp
question_answers.push([question,answer])
if i >= 2
  • As a visitor, I want to understand what the site is offering so I can quickly orient myself
    • I should see a tagline on the main page
    • I should see a brief summary on the main page
  • As a visitor, I want to sign up so I can save my progress and receive updates
    • I should see a sign up link on the index
    • I should see a form that allows me to sign up
    • I should be required to provide a unique user name or email
    • I should be required to provide a strong password
    • I should be required to confirm my password
  • I should be signed in after completing the form
@mikeraimondi
mikeraimondi / gist:5625024
Created May 22, 2013 03:18
Rails has_many association
class CrazyCatLady < ActiveRecord::Base
has_many :cats
end
class Cat < ActiveRecord::Base
belongs_to :crazy_cat_lady
end
class CrazyCatLady < ActiveRecord::Base
has_many :cats,
inverse_of: :crazy_cat_lady
end
class Cat < ActiveRecord::Base
belongs_to :crazy_cat_lady,
inverse_of: :cats
end
@mikeraimondi
mikeraimondi / null_constraint_example.rb
Created June 5, 2013 03:08
null constraint example
class CreateWidgets < ActiveRecord::Migration
def change
create_table :widgets do |t|
t.string :name, null: false
t.string :description
t.timestamps
end
end
end