- Is the elephant in your menu bar?
- Are you pointing to the correct psql?
$ which psql
=> /Applications/Postgres.app/Contents/MacOS/bin/psql
# Moviez | |
Use the IMDB gem to create a new movies_app. | |
Users should be able to search for movies. | |
Display search results that link to a show page for each movie. | |
Include a button to save favorited movies to the database. | |
Saved movies should have a title, year, plot, mpaa_rating and a rating that goes from 0 to 100. |
var lStations = [ "8th", "6th", "Union Square", "3rd", "1st" ]; | |
var nStations = [ "Times Square", "34th", "28th", "23rd", "Union Square", "8th" ]; | |
var sixStations = [ "Grand Central", "33rd", "28th", "23rd", "Union Square", "Astor Place" ]; | |
var gStations = [ "Greenpoint", "Nassau", "Metropolitan", "Broadway" ]; | |
// write a function that accepts a line, and returns a function | |
// to calculate the distance between two stops on one line | |
function getDistanceForLine(line){ | |
// code here? |
# Optimization Gems | |
group :development do | |
gem 'bullet' # help to kill N+1 queries and unused eager loading | |
# https://github.com/flyerhzm/bullet | |
gem 'lol_dba' # scans your models and displays a list of columns that should be indexed | |
# https://github.com/plentz/lol_dba | |
gem 'rack-mini-profiler' # displays speed badge for every html page. | |
# https://github.com/harleyttd/miniprofiler | |
gem 'rails_best_practices' # a code metric tool to check the quality of rails codes | |
# https://github.com/railsbp/rails_best_practices |
group :test do | |
gem 'cucumber' # a tool for running automated tests written in plain language | |
# https://github.com/cucumber/cucumber | |
gem 'test-unit' | |
gem 'guard' | |
gem 'guard-rspec' | |
gem 'shoulda-matchers' | |
gem 'rb-fsevent' | |
end |
client = Dalli::Client.new | |
config.action_dispatch.rack_cache = { | |
metastore: client, | |
entitystore: client, | |
allow_reload: false | |
} | |
config.cache_store = :dalli_store | |
config.serve_static_assets = true |
# ./Procfile | |
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb |
# ./Procfile | |
web: bundle exec puma -p $PORT -C ./config/puma.rb |
# If your postgres isn't working properly | |
## check | |
- Is the elephant in your menu bar? | |
- Are you pointing to the correct psql? | |
``` | |
$ which psql | |
=> /Applications/Postgres.app/Contents/MacOS/bin/psql | |
``` |
############## | |
### Benchmarks | |
############## | |
require 'benchmark' | |
# http://www.ruby-doc.org/stdlib-1.9.3/libdoc/benchmark/rdoc/Benchmark.html | |
# http://rubylearning.com/blog/2013/06/19/how-do-i-benchmark-ruby-code/ | |
# http://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1/556411#556411 | |
iterations = 100_000 # How many times to test? |