Skip to content

Instantly share code, notes, and snippets.

@kamiiyu
kamiiyu / perlbrew_libgcc_s.txt
Created January 3, 2019 09:57 — forked from Dreyer/perlbrew_libgcc_s.txt
[perlbrew] ld: library not found for -lgcc_s.10.4
$ 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
@kamiiyu
kamiiyu / proc.rb
Created January 17, 2018 14:26 — forked from qrush/proc.rb
Rails 3.2 Tagged Logger examples
# somewhere in your middleware stack...
# request.env['yourapp.someid'] = "1337"
YourApp::Application.configure do
config.log_tags = [
-> request {
request.env['yourapp.someid']
}
]
end
@kamiiyu
kamiiyu / rails http status codes
Last active November 16, 2017 06:52 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
2xx Success
200 :ok
201 :created
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
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
@kamiiyu
kamiiyu / 0_reuse_code.js
Created July 28, 2016 02:58
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