Skip to content

Instantly share code, notes, and snippets.

View libbyschuknight's full-sized avatar
🏡
Working remotely

Libby Schumacher-Knight libbyschuknight

🏡
Working remotely
View GitHub Profile
class Queue
def initialize
@store = []
end
def push(x)
@store.unshift(x)
end
def pop
@libbyschuknight
libbyschuknight / 0_reuse_code.js
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$ rails new "app_name" --database=postgresql --skip-test-unit
$cd "app_name"
$ git init
$ git add -A
$ git commit -m "first commit message"
@libbyschuknight
libbyschuknight / testing_steps
Last active August 29, 2015 14:25
Testing Steps when creating a new Rails app
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?
@libbyschuknight
libbyschuknight / git_stuff
Last active December 21, 2015 19:20
Git stuff
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
@libbyschuknight
libbyschuknight / heroku-deployment
Last active August 29, 2015 14:26
Deploying Ruby on Rails app to Heroku
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
@libbyschuknight
libbyschuknight / using_animate_jquery.js
Created August 3, 2015 03:32
using animate() in jquery
$('img').mouseenter(function () {
$(this).css({border: '0 solid #f37736'}).animate({
borderWidth: 4
}, 500);
}).mouseleave(function () {
$(this).animate({
borderWidth: 0
}, 500).hide();
});
$(document).ready(function() {
//run the code
// console.log("this is loading")
$(document).keyup(function(e) {
// console.log(e)
updatePlayerPosition(e.keyCode)
});
});