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
| def all_times employees | |
| employees.collect {|employee| employee[:time_working]} | |
| end | |
| def helped_by cust_num, employees | |
| employees.each do |employee| | |
| if employee[:cust_helped].include? cust_num | |
| puts "#{employee[:name].capitalize} helped customer ##{cust_num}." | |
| puts "\n" | |
| 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 'sqlite3' | |
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new(STDERR) | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => 'sqlite3', | |
| :database => 'dbfile_example' | |
| ) | |
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 Hack | |
| def initialize words | |
| @words = words.downcase.split(/\/|\s|,\s|\,/) | |
| @splitwords = [] | |
| @words.each { |w| @splitwords << w.split('') } | |
| show_likely | |
| end | |
| def deduct |
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
| #!/usr/bin/env/ ruby | |
| require_relative('fp') | |
| require 'sinatra' | |
| require 'json' | |
| t = FlightTracker.new | |
| get '/' do |
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 'socket' # Get sockets from stdlib | |
| require 'json' | |
| require 'active_support/all' | |
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new(STDERR) | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => 'sqlite3', | |
| :database => 'project_db' |
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 'socket' # Get sockets from stdlib | |
| require 'json' | |
| require 'active_support/all' | |
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new(STDERR) | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => 'sqlite3', | |
| :database => 'project_db' |
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
| <div> | |
| <form className="ui-filterable" id="searchbar"> | |
| <input id="inset-autocomplete-input" data-type="search" placeholder="Search foods..."></input> | |
| </form> | |
| <ul data-role="listview" data-inset="true" data-filter="true" data-filter-reveal="true" data-input="#inset-autocomplete-input"> | |
| {Object.keys(this.state.foods).forEach((food) => { | |
| return ( | |
| <li><a href="#">food</a></li> | |
| ); | |
| })} |
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
| <div> | |
| <form className="ui-filterable" id="searchbar"> | |
| <input id="inset-autocomplete-input" data-type="search" placeholder="Search foods..."></input> | |
| </form> | |
| <ul data-role="listview" data-inset="true" data-filter="true" data-filter-reveal="true" data-input="#inset-autocomplete-input"> | |
| {Object.keys(this.state.foods).forEach((food) => { | |
| return ( | |
| <li><a href="#">food</a></li> | |
| ); | |
| })} |
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
| <div> | |
| <form className="ui-filterable" id="searchbar"> | |
| <input id="inset-autocomplete-input" data-type="search" placeholder="Search foods..."></input> | |
| </form> | |
| <ul data-role="listview" data-inset="true" data-filter="true" data-filter-reveal="true" data-input="#inset-autocomplete-input"> | |
| {Object.keys(this.state.foods).forEach((food) => { | |
| return ( | |
| <li><a href="#">food</a></li> | |
| ); | |
| })} |
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
| def valid_word? word | |
| letters = { | |
| 'e' => 12, | |
| 'a' => 9, | |
| 'i' => 9, | |
| 'o' => 8, | |
| 'n' => 6, | |
| 'r' => 6, | |
| 't' => 6, | |
| 'l' => 4, |
OlderNewer