This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def queue_print | |
puts @queue.to_s.upcase | |
puts "LAST_NAME".ljust(15)+"FIRST_NAME".ljust(15)+"EMAIL".ljust(50)+"ZIPCODE".ljust(15)+"CITY".ljust(30)+"STATE".ljust(15)+"ADDRESS".ljust(50)+"PHONE".ljust(15) | |
@queue.each do |row| | |
puts row[:last_name].ljust(15)+row[:first_name].ljust(15)+row[:email_address].ljust(50)+row[:zipcode].ljust(15)+row[:city].ljust(30)+row[:state].ljust(15)+row[:street].ljust(15)+"#{@phonenumber}" | |
end | |
# print @queue[0] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Scrabble | |
def initialize | |
SCORES = {"A"=>1, "B"=>3, "C"=>3, "D"=>2, "E"=>1, "F"=>4, "G"=>2, "H"=>4, "I"=>1, "J"=>8, | |
"K"=>5, "L"=>1, "M"=>3, "N"=>1, "O"=>1, "P"=>3, "Q"=>10, "R"=>1, "S"=>1, "T"=>1, | |
"U"=>1, "V"=>4, "W"=>4, "X"=>8, "Y"=>4, "Z"=>10} | |
end | |
def self.score(word) | |
SCORES[word.upcase] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class ArticlesControllerTest < ActionController::TestCase | |
test "index method lists all articles" do | |
Article.create(title: "First", body: "Body") | |
Article.create(title: "Second", body: "Body") | |
articles = Article.all | |
assert_equal 2, articles.count | |
#when I run rake, getting 4 articles instead of 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return true if number.even? | |
else | |
return false | |
vs. | |
def test_count_one_word | |
phrase = Phrase.new("word") | |
counts = {"word" => 1} | |
assert_equal counts, phrase.word_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hamming | |
def self.compute(sequence1, sequence2) | |
sequence1 = sequence1.split('') | |
sequence2 = sequence2.split('') | |
sequence1.zip(sequence2).count do |string_a, string_b| | |
self.substitution?(string_a, string_b) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "adding items and viewing cart" do | |
it "has unique cart for each restaurant" do | |
new_restaurant = FactoryGirl.create(:restaurant) | |
new_item = FactoryGirl.create(:item, restaurant_id: new_restaurant.id) | |
visit "/#{new_restaurant.slug}" | |
click_on('Add to Cart') | |
expect(page).to have_content("Bacon") | |
new_restaurant2 = FactoryGirl.create(:restaurant, title: "Parsley", description: "blah balh") | |
new_item2 = FactoryGirl.create(:item, restaurant_id: new_restaurant2.id, title: "brown fried food", description: "fried brown food") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'oauth' | |
require 'json' | |
require 'pp' | |
CONSUMER_KEY = OAuth::Consumer.new( | |
'qLqLjhVG6TQDesSYnT3bw', | |
'9Zw1OIB17651BMZUEsRlA5CKk3qG1MJclzr0f0Qq0') | |
ACCESS_TOKEN = OAuth::Token.new( | |
'321130543-9SPLOfIzXbHDuWnaZSyBBm3ctix0xrh6REooGZSd', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runtime! autoload/pathogen.vim | |
syntax on | |
filetype plugin indent on | |
set visualbell | |
set wildmenu | |
set wildmode=list:longest,full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Failure: | |
Api::SearchTest#test__search_issues_sort_issues_in_ascending_order_L936 [/Users/bryanaknight/github/github/test/integration/api/search_test.rb:941]: | |
Expected: 2 | |
Actual: 0 | |
2) Failure: | |
Api::SearchTest#test__search_issues_include_issues_in_private_repo_for_integration_bot_with_access_to_the_repo_s_issues__with_search_scoped_to_that_repo_L853 [/Users/bryanaknight/github/github/test/integ$ | |
ation/api/search_test.rb:865]: | |
Expected: 1 | |
Actual: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module GitHub | |
class Cache | |
def fetch(*opts) | |
opts[:cache_key].prepend current_tenant.id | |
super(opts) | |
end | |
def get(*opts) | |
opts[:cache_key].prepend current_tenant.id |
OlderNewer