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
| Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes. | |
| function spinalCase(str) { | |
| return str.toLowerCase().replace(/ |_/gi, '-'); // use the | for or matching | |
| // need to find match case [a-z] sequence | |
| } | |
| spinalCase('This Is Spinal Tap'); |
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
| php --version | |
| PHP 7.1.8 (cli) (built: Aug 7 2017 15:02:45) ( NTS ) | |
| Copyright (c) 1997-2017 The PHP Group | |
| Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies | |
| httpd -v | |
| Server version: Apache/2.4.25 (Unix) | |
| Server built: Feb 6 2017 20:02:10 |
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
| scratch.rb | |
| class Card | |
| # wrongly added has_one | |
| # one card can have many guesses from different users | |
| # or even during different rounds | |
| has_many :guesses | |
| 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
| Rotten Tomatoes api | |
| IMDB api | |
| google sheet integration for db management | |
| basically a crud app with user reviews and comments | |
| ---------------------------------- |
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
| console: | |
| gem install bundler | |
| rbenv local 2.2.2 | |
| bundle install | |
| $ postgres -D /usr/local/var/postgres | |
| FATAL: lock file "postmaster.pid" already exists |
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
| # installing gems | |
| gem install bundler | |
| # install bundler should already be here on dbc machines | |
| bundle install | |
| # creating database | |
| # makes two dbs - one for model, one test | |
| bundle exec rake db:create |
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
| need a merge conflict xy_wing array maybe | |
| or just assign the variables of the board from within the recursie loop because that's worked before with the lone single |
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
| change instance vars of positions to self.position | |
| because that's the position for the current player | |
| delete player instance variable then just pass players into the starting_position (formerly overwriting with position method) | |
| make attr reader for position | |
| use insert and to_s to the value | |
| have a hash value be knowing the position and player name |
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 'prime' | |
| def prime_factors(number, output = []) | |
| return [number] if number.prime? | |
| # write def prime base case checker in method | |
| # return output if number.prime? | |
| factors = (2...number/2).to_a.select do |potential_factor| | |
| number % potential_factor == 0 | |
| 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
| Just as it is the responsibility of our plain Ruby classes to instantiate new instances of themselves, | |
| Active Record model classes are also responsible for instantiating instances of themselves | |
| bundle exec rake console |