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 Queue | |
def initialize | |
@store = [] | |
end | |
def push(x) | |
@store.unshift(x) | |
end | |
def pop |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
$ rails new "app_name" --database=postgresql --skip-test-unit | |
$cd "app_name" | |
$ git init | |
$ git add -A | |
$ git commit -m "first commit message" |
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
Magic Tricks of Testing (RailsConf) by Sandi Metz | |
https://speakerdeck.com/skmetz/magic-tricks-of-testing-railsconf | |
https://www.youtube.com/watch?v=URSWYvyc42M | |
Once created first model/resource - and have spec files | |
(Need to have run first migration and seeded some data) | |
Break down what you want each model/controller etc to do - e.g. what do I want to get out of the Ingredient model? |
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
git clone | |
git fetch origin branch - to get branch other than master | |
git checkout branch | |
IF HAVE PUSHED TO MASTER AND DIDN'T MEAN TO | |
git checkout -b libby | |
git stash save "Working on DOM" | |
git stash list | |
git checkout master |
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
Click on an image in a link with Capybara | |
find(:xpath, "//a/img[@alt='Edit']/..").click |
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
save_and_open_page | |
puts page.body |
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
https://devcenter.heroku.com/articles/getting-started-with-rails4#local-workstation-setup | |
https://devcenter.heroku.com/articles/getting-started-with-ruby#introduction | |
heroku login | |
- To run on Heroku your app must be configured to use the Postgres database, have all dependencies declared in your Gemfile, and have the rails_12factor gem in the production group of your Gemfile | |
gem 'rails_12factor', group: :production | |
gem 'pg' - make sure have |
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
$('img').mouseenter(function () { | |
$(this).css({border: '0 solid #f37736'}).animate({ | |
borderWidth: 4 | |
}, 500); | |
}).mouseleave(function () { | |
$(this).animate({ | |
borderWidth: 0 | |
}, 500).hide(); | |
}); |
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
$(document).ready(function() { | |
//run the code | |
// console.log("this is loading") | |
$(document).keyup(function(e) { | |
// console.log(e) | |
updatePlayerPosition(e.keyCode) | |
}); | |
}); |
OlderNewer