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
| $ cd /usr/local/lib | |
| $ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib | |
| $ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib |
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
| # somewhere in your middleware stack... | |
| # request.env['yourapp.someid'] = "1337" | |
| YourApp::Application.configure do | |
| config.log_tags = [ | |
| -> request { | |
| request.env['yourapp.someid'] | |
| } | |
| ] | |
| end |
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
| HTTP status code symbols for Rails | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing | |
| 2xx Success | |
| 200 :ok | |
| 201 :created |
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
| ruby -rbundler/inline -e "gemfile(true) do; source 'https://rubygems.org/'; gem 'rails', '5.1.0.beta1'; end" | |
| rails new blog --webpack=angular|react | |
| rails g scaffold post name content:text views:integer | |
| yarn global add create-react-app react-http-request | |
| yarn add axios |
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 ApplicationController < ActionController::Base | |
| include Pundit | |
| # Verify that controller actions are authorized. Optional, but good. | |
| after_filter :verify_authorized, except: :index | |
| after_filter :verify_policy_scoped, only: :index | |
| rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized | |
| private |
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 |