This file contains 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
# File: config/initializers/params_snakeizer.rb | |
# Transform JSON request param keys from JSON-conventional camelCase to | |
# Rails-conventional snake_case | |
module ActionController | |
# Modified from action_controller/metal/strong_parameters.rb | |
class Parameters | |
def deep_snakeize! | |
@parameters.deep_transform_keys!(&:underscore) | |
self | |
end |
This file contains 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
3 <=> 4 | |
3 > 4 | |
Class Steak | |
include Comparable | |
attr_accessor grade | |
GRADES = { prime: 1, choice: 2, select: 3 } | |
def <=>(other) |
This file contains 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
macOS High Sierra | |
https://www.apple.com/jp/macos/high-sierra/ | |
Xcode 9 | |
https://developer.apple.com/download/ | |
xcode-select --install | |
brew upgrade |
This file contains 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
# Input: 901,1,187,7,1,[email protected],"{""u"":""name"",""limit_date"":""2017/09/18 23:59"",""token"":""b0kasdfuadf3jdadfubd"",""language"":""ja""}",9/12/17 9:01,NULL,NULL,NULL,9/11/17 15:59,9/11/17 16:00,NULL | |
# Output: b0kasdfuadf3jdadfubd | |
cat token_lists.csv | jq -R 'split(",") | .[8] | split("\"") | .[6]' | sed 's/"//g' |
This file contains 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
brew install imagemagick@6 | |
export PATH="/usr/local/opt/imagemagick@6/bin:$PATH" | |
export LDFLAGS=-L/usr/local/opt/imagemagick@6/lib:$LDFLAGS | |
export CPPFLAGS=-I/usr/local/opt/imagemagick@6/include:$CPPFLAGS | |
export PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig:$PKG_CONFIG_PATH | |
gem install rmagic | |
# https://stackoverflow.com/questions/10063051/bundle-cant-install-rmagick-gem-on-mac-osx-10-7 |
Instructions for installing mysql on mac os x via homebrew (a command line package manager for mac)
Follow installation instructions at https://brew.sh/
- OS: Ubuntu 14.04 LTS
- dockerをインストール
- dockerのuser groupを設定
- docker-composeをインストール
- Install Docker using the convenience script
2017/08/07: Install Docker using the convenience scriptがうまく行った。従来の方法でやると何故かエラがでる。
Failed to fetch https://download.docker.com/linux/ubuntu/dists/trusty/InRelease Unable to find expected entry 'table/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)
This file contains 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
# Sync a fork of a repository to keep it up-to-date with the upstream repository. | |
# https://help.github.com/articles/syncing-a-fork/ | |
git fetch upstream | |
git checkout master | |
git merge upstream/master | |
git push |