Skip to content

Instantly share code, notes, and snippets.

@wannabefro
wannabefro / gist.txt
Created May 2, 2013 20:38
i_use_gist.txt
I now
Use
Gist
@wannabefro
wannabefro / user_stories.txt
Created May 2, 2013 21:39
user_stories(sam & dave).txt
I am a subscriber
I want to view full articles
So that I can get convenient access to the news
I am a non-subscriber
I want to preview the article and be able to subscribe
So that I may read the full text if I find it interesting
I am a author
I want to know who's reading my articles
=========================================================
I am a subscriber
I want to view full articles
So that I can get convenient access to the news
---------------------------------------------------------
Subscriber Acceptance Requirements:
-Subscriber logs in system recognizes him as a subscriber allows full access to articles
=========================================================
I am a non-subscriber
I want to preview the article and be able to subscribe
@wannabefro
wannabefro / terminal.txt
Created May 3, 2013 17:23
Terminal excersise on apollo
➜ ~ echo "hello world"
hello world
➜ ~ ls -a
. .bash_profile .irb-history .subversion Applications Movies
.. .bashrc .irbc .viminfo Calibre Library Music
.CFUserTextEncoding .codeintel .irbrc .zcompdump Desktop Pictures
.DS_Store .cups .lesshst .zprofile Documents Public
.Trash .dropbox .oh-my-zsh .zsh-update Downloads
.adobe .fontconfig .rnd .zsh_history Dropbox
➜ Documents mkdir challenge_app
➜ Documents cd challenge_app
➜ challenge_app rails new challenge_1
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
@wannabefro
wannabefro / git_challenge_2.txt
Created May 3, 2013 18:34
git challenge 2 from apollo
➜ challenge_app_1 git:(master) cd ~
➜ ~ cd Documents
➜ Documents mkdir challenge_2
➜ Documents cd challenge_2
➜ challenge_2 rails new challenge_2
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
@wannabefro
wannabefro / newlypair.rb
Created May 6, 2013 15:41
newly paired problem
questions = [{:"What is your name?" => "Arthur"}, {:"What is your quest?" => "The holy grail"},
{:"What is the airspeed velocity of an unlader swallow?" => "African or European?"}]
points = 0
point_value = 1
i = 0
while questions[i] != nil
puts questions[i].keys
answer = gets.chomp.downcase
if answer == questions[i].values[0].downcase
@wannabefro
wannabefro / sublimetips.md
Created November 12, 2013 22:00
sublime stuff

Sublime Text Tips & Tricks

Command P || Command T

Press Command + T or Command + P, type in the name of the file you wish to access (fuzzy finder), and, without even pressing Enter, you’ll instantly be transported to that file.

Shift Command P

We can use Sublime’s command palette by accessing the Tools menu, or by pressing Shift + Command + P, on the Mac.

Whether you need to visit a Preferences page, or paste in a snippet, all of that can be accomplished here.

@wannabefro
wannabefro / CSV.rb
Created November 21, 2013 16:17
writing and reading files with ruby
require 'CSV'
day_cost = {}
CSV.foreach('hello.csv', headers: true) do |row|
day_cost[row[0]] = row[1]
end
def hourly_wage(wage)
wage.tr('$', '').to_f / 10
end
CSV.foreach(file,
headers: true,
converters: lambda{|s| s.gsub(',','').to_i ? s && s[0] =~ /\d/ : s}) do |row|
TownHealthRecords.find_or_initialize_by(geography: row['geography']) do |thr|
thr.population = row['population']
save!
end
end