Skip to content

Instantly share code, notes, and snippets.

View nacyot's full-sized avatar
🧶
The Science of Hitting

Daegwon Nacyot Kim nacyot

🧶
The Science of Hitting
View GitHub Profile
@nacyot
nacyot / 2013-03-04-ruby-trivias-you-should-know-4.md
Last active April 17, 2024 05:01
알아두면 도움이 되는 55가지 루비 기법
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash

Ruby の HTTP クライアントライブラリ Faraday が便利そう

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] というものがよく使われてた

diff --git a/Cask b/Cask
index 3c46d75..a4b03b0 100644
--- a/Cask
+++ b/Cask
@@ -1,28 +1,21 @@
(source gnu)
-(source melpa)
(source marmalade)
+(source melpa)
@nacyot
nacyot / macro.el
Last active August 29, 2015 14:02
emacs : 옆에 있는 term-buffer 복사 붙여넣기 실행 매크로.
(defun copy-and-paste-current-line ()
(interactive)
(end-of-line)
(set-mark (line-beginning-position))
(kill-region (region-beginning) (region-end))
(other-window 1)
(yank)
(term-send-input)
(other-window 1))
bind r source-file ~/.tmux.conf \; display "Reloaded!"
set -g default-shell /bin/zsh
set -g base-index 1
setw -g pane-base-index 1
bind | split-window -h
bind - split-window -v