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
| # Brewfile | |
| cask_args appdir: "/Applications" | |
| tap "caskroom/cask" | |
| tap "homebrew/bundle" | |
| tap "homebrew/core" | |
| cask "google-chrome" | |
| cask "slack" | |
| cask "github" | |
| brew "git" |
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
| # rubocop v0.51 の変換結果、正しい | |
| if user&.group&.admin? | |
| puts 'userが管理者です' | |
| else | |
| puts 'userがnilか、管理者ではないです' | |
| end | |
| # rubocop v0.51は以下の様に間違って変換 | |
| if !user&.group&.admin? | |
| puts 'userが普通ユーザです' |
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
| # 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 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
| 3 <=> 4 | |
| 3 > 4 | |
| Class Steak | |
| include Comparable | |
| attr_accessor grade | |
| GRADES = { prime: 1, choice: 2, select: 3 } | |
| def <=>(other) |
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
| 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 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
| # Input: 901,1,187,7,1,example@gmail.com,"{""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 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
| 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/