This file contains hidden or 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
| katz_deli = [] | |
| def take_a_number(deli, name) | |
| deli << name | |
| puts deli.index(name)+1 | |
| end | |
| def now_serving(deli) | |
| puts "Currently serving #{deli[0]}" | |
| deli.shift |
This file contains hidden or 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
| # Hashketball Nests | |
| # | |
| # Great news! You're going to an NBA game! The only catch is that you've been | |
| # volunteered to keep stats at the game. | |
| # | |
| # Using Nested Hashes, define a game, with two teams, their players, and the players stats: | |
| # | |
| # The game has two teams. | |
| # | |
| # A team has: |
This file contains hidden or 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
| my_none?([1,2,3]) { |x| x == 4 } |
This file contains hidden or 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
| ######################## | |
| # NYC PIGEON ORGANIZER # | |
| ######################## | |
| # Start with the following collected data on NYC pigeons. | |
| require 'pry' | |
| pigeon_data = { | |
| :color => { | |
| :purple => ["Theo", "Peter Jr.", "Lucky"], |
This file contains hidden or 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
| # Scraping Most Voted Hackernews | |
| require 'pry' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| # Get all the Posts on Hackernews | |
| # student_profile = Nokogiri::HTML(open('http://students.flatironschool.com/students/greg_eng.html')) | |
| student_index_page = Nokogiri::HTML(open('http://students.flatironschool.com')) |
This file contains hidden or 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 'pry' | |
| class SecretHandshake | |
| attr_accessor :binary | |
| def initialize(binary) | |
| @binary = binary | |
| end | |
| def commands |
This file contains hidden or 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
| # Build a Jukebox | |
| require 'pry' | |
| songs = [ | |
| "The Phoenix - 1901", | |
| "Tokyo Police Club - Wait Up", | |
| "Sufjan Stevens - Too Much", | |
| "The Naked and the Famous - Young Blood", | |
| "(Far From) Home - Tiga", |
This file contains hidden or 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 'pry' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require_relative './student_scrape' | |
| class Student | |
| attr_accessor :name, :twitter, :linkedin, :facebook, :website | |
| @@students = [] | |
| def initialize(name, twitter, linkedin, facebook, website) |
This file contains hidden or 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 Array | |
| def my_each | |
| i = 0 | |
| while i < self.length | |
| yield(self[i]) | |
| i+=1 | |
| end | |
| self | |
| end |
This file contains hidden or 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 'pry' | |
| class Anagram | |
| attr_reader :word | |
| def initialize(word) | |
| @word = word | |
| end | |
| def match(array=%w(hello world zombies pants)) |