Skip to content

Instantly share code, notes, and snippets.

@frankjmattia
frankjmattia / installing-rust-on-10.12-beta-2.md
Last active July 10, 2016 19:10
How I got Rust to build on MacOS 10.12-beta-2

Clone the rust source someplace local.

$ git clone https://github.com/rust-lang/rust.git
$ cd rust

Then apply pull request #34686. I did it by hand because I don't know any better.

Edit src/stage0.txt to the latest nightly to work around issue #34674.

@frankjmattia
frankjmattia / hiding_tasks.rb
Created July 6, 2016 17:43
How could you make this code more self documenting?
# This effectively hides the `engine_name:install:migrations` task from `$ rake -T`.
Rake::Task["engine_name:install:migrations"].instance_variable_set(:@comments, [])
user_session_new GET /users/sign_in(.:format) {:action=>"new", :controller=>"devise/sessions"}
user_session POST /users/sign_in(.:format) {:action=>"create", :controller=>"devise/sessions"}
user_session_destroy GET /users/sign_out(.:format) {:action=>"destroy", :controller=>"devise/sessions"}
POST /users/password(.:format) {:action=>"create", :controller=>"devise/passwords"}
new_user_password GET /users/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"}
edit_user_password GET /users/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"}
user_password PUT /users/password(.:format) {:action=>"update", :controller=>"devise/passwords"}
cancel_user_registration GET /users/cancel(.:format) {:action=>"cancel", :controller=>"users/registrations"}
MetaWhere::JoinDependency::AssociationNotFoundError in ProjectsController#index
Association named 'projects' was not found; perhaps you misspelled it?
/Users/frankjmattia/.rvm/gems/ruby-1.9.2-rc1/bundler/gems/meta_where-ec52b89/lib/meta_where/join_dependency.rb:18:in `build_with_metawhere'
/Users/frankjmattia/.rvm/gems/ruby-1.9.2-rc1/bundler/gems/meta_where-ec52b89/lib/meta_where/join_dependency.rb:26:in `block in build_with_metawhere'
/Users/frankjmattia/.rvm/gems/ruby-1.9.2-rc1/bundler/gems/meta_where-ec52b89/lib/meta_where/join_dependency.rb:25:in `each'
/Users/frankjmattia/.rvm/gems/ruby-1.9.2-rc1/bundler/gems/meta_where-ec52b89/lib/meta_where/join_dependency.rb:25:in `build_with_metawhere'
/Users/frankjmattia/.rvm/gems/ruby-1.9.2-rc1/bundler/gems/rails-4dc2521/activerecord/lib/active_record/associations.rb:1849:in `initialize'
/Users/frankjmattia/.rvm/gems/ruby-1.9.2-rc1/bundler/gems/meta_where-ec52b89/lib/meta_where/relation.rb:135:in `new'
# app/controllers/users/registrations_controller.rb
class Users::RegistrationsController < Devise::RegistrationsController
def create
build_resource
if resource.save
if resource.respond_to?(:confirm!) && !resource.confirmed?
confirmation_hash = Digest::SHA2.hexdigest(resource.password_salt + resource.confirmation_token)
redirect_to awaiting_confirmation_path(resource, confirmation_hash)
else
class Users::RegistrationsController < Devise::RegistrationsController
def create
build_resource
if resource.save
set_flash_message :notice, :signed_up
if resource.confirmed?
sign_in_and_redirect(resource_name, resource)
else
redirect_to some_other_url
ArgumentError undefined class/module User
/Users/frankjmattia/.rvm/gems/ruby-head/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/message_verifier.rb:34:in `load'
/Users/frankjmattia/.rvm/gems/ruby-head/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/message_verifier.rb:34:in `verify'
/Users/frankjmattia/.rvm/gems/ruby-head/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/cookies.rb:219:in `[]'
/Users/frankjmattia/.rvm/gems/ruby-head/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb:66:in `unpacked_cookie_data'
/Users/frankjmattia/.rvm/gems/ruby-head/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb:57:in `extract_session_id'
/Users/frankjmattia/.rvm/gems/ruby-head/bundler/gems/rails-