A list of presenters at the Brooklyn Swift Developers Meetup with links to videos, slides and source code: http://www.meetup.com/Brooklyn-Swift-Developers
Taiki Suzuki - Flux & MVVM (Video)
Harlan Kellaway - Should Code Always be DRY? (Video)
A list of presenters at the Brooklyn Swift Developers Meetup with links to videos, slides and source code: http://www.meetup.com/Brooklyn-Swift-Developers
Taiki Suzuki - Flux & MVVM (Video)
Harlan Kellaway - Should Code Always be DRY? (Video)
| # Copy the gem location to clipboard | |
| bundle show yajl-ruby | pbcopy | |
| # Example: /Users/gedrovits/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/yajl-ruby-0.8.2 | |
| cd <cmd + v> | |
| cd ext/yajl | |
| # Now we need to replace 'inline void' to 'static void'. This will also create backup of old files. | |
| sed -i '.bak' 's/inline void/static void/g' yajl_ext.h yajl_ext.c | |
| # Now we must rebuild changed extension | |
| make clean all | |
| # After this you should not have any problems with yajl-ruby |
| #!/bin/sh | |
| JASMINE_URL="http://localhost:8888/?spec=" | |
| if [ -z "$1" ]; then | |
| echo "Opening $JASMINE_URL to run all the tests" | |
| open "$JASMINE_URL" | |
| exit 0 | |
| fi |
| source 'https://rubygems.org' | |
| gem 'rails', '3.2.3' | |
| # Gems used only for assets and not required | |
| # in production environments by default. | |
| group :assets do | |
| gem 'sass-rails', '~> 3.2.3' | |
| gem 'coffee-rails', '~> 3.2.1' | |
| # See https://github.com/sstephenson/execjs#readme for more supported runtimes |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| $ rails console | |
| Loading development environment (Rails 3.0.6) | |
| ruby-1.8.7-p334 :001 > r = Rails.application.routes | |
| Gives you a handle of all the routes (config/routes.rb) | |
| #Inspect a named route: | |
| ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path) | |
| => {:action=>"destroy", :controller=>"sessions"} |
| require 'rubygems' | |
| require 'right_aws' | |
| aws_access_key_id = 'your-access-key' | |
| aws_secret_access_key = 'your-secret-key' | |
| target_bucket = 'your-source-bucket' | |
| destination_bucket = 'your-destination-bucket' | |
| s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key) |
| # Setting up a local solr instance on a mac | |
| # install solr with homebrew | |
| brew install solr | |
| # create the base solr index directory | |
| mkdir -p /data/solr | |
| # make sure you can write to the solr logs | |
| sudo chown -R `whoami` /usr/local/Cellar/solr/ |