rbenv, ruby-buildを更新
$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
| # encoding: utf-8 | |
| module TelSplitter | |
| MAP = { | |
| # 市外局番 , 市内局番の桁数のマップ | |
| # http://www.soumu.go.jp/main_sosiki/joho_tsusin/top/tel_number/number_shitei.html のデータを利用 | |
| # 固定電話以外の桁数は適当です... | |
| '050' => 4, # IP電話 | |
| '070' => 4, # 携帯電話/PHS | |
| '080' => 4, # 携帯電話 |
| // Original method | |
| var object = { | |
| method: function (x, y) { | |
| return x+y; | |
| } | |
| } | |
| // Add operations before or after! | |
| object.method = (function (original) { | |
| return function (x, y) { |
| GOSH=/usr/local/bin/gosh | |
| L=./gu.scm | |
| test: | |
| $(GOSH) -l $(L) ./*test.scm |
| # store all solarized files in one place | |
| mkdir ~/.solarized | |
| cd ~/.solarized | |
| # http://www.webupd8.org/2011/04/solarized-must-have-color-paletter-for.html | |
| git clone https://github.com/seebi/dircolors-solarized.git | |
| eval `dircolors ~/.solarized/dircolors-solarized/dircolors.256dark` | |
| ln -s ~/.solarized/dircolors-solarized/dircolors.256dark ~/.dir_colors | |
| git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git |
| $! raise された例外オブジェクト | |
| $" require で読み込まれたファイルの配列 | |
| $# | |
| $$ 現在のプロセス ID | |
| $% | |
| $& 正規表現にマッチした箇所の文字列 | |
| $' 正規表現にマッチした箇所より後ろの文字列 | |
| $( | |
| $) | |
| $* Ruby スクリプトに指定された引数。ARGV と同じ |
Ruby の HTTP クライアントライブラリ Faraday が便利そう
API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた
[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた
| #!/bin/bash | |
| # attach to an existing tmux session, or create one if none exist | |
| # also set up access to the system clipboard from within tmux when possible | |
| if [[ $OSTYPE == darwin* && -x $(command -v reattach-to-user-namespace) ]]; then | |
| # on OS X force tmux's default command to spawn a shell in the user's namespace | |
| # https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard | |
| tweaked_config=$(cat $HOME/.tmux.conf <(echo 'set-option -g default-command "reattach-to-user-namespace -l $SHELL"')) |