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

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

Description

Dashing widget to show the build status of a CircleCI project.

Usage

  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install

Then:

whisper:
image: nacyot/whisper
carboncache:
image: nacyot/carbon-cache
ports:
- "2003:2003"
- "2004:2004"
- "7002:7002"
volumes_from:
[server]
handlers = diamond.handler.graphite.GraphiteHandler, diamond.handler.archive.ArchiveHandler
user =
group =
collectors_path = /usr/share/diamond/collectors/
collectors_config_path = /etc/diamond/collectors/
handlers_config_path = /etc/diamond/handlers/
handlers_path = /usr/share/diamond/handlers/
collectors_reload_interval = 3600
@version: 3.5
@include "scl.conf"
options {
time_reap(30);
mark_freq(10);
keep_hostname(yes);
};
source src {
unix-stream("/dev/log");
sudo mkdir -p /opt/jq
wget -O /opt/jq/jq http://stedolan.github.io/jq/download/linux64/jq
chmod +x /opt/jq/jq
sudo ln -s /opt/jq/jq /usr/local/bin