Skip to content

Instantly share code, notes, and snippets.

View zires's full-sized avatar
🎎
anxiety

zshuaibin zires

🎎
anxiety
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
@zires
zires / usage
Created March 27, 2014 09:10
docker
docker ps -a | grep Exit | awk '{print $1}' | sudo xargs docker rm
docker rm `docker ps -a -q`
docker rmi the_image
docker rmi $(docker images -q)
@zires
zires / deploy.rb
Created October 23, 2013 02:46 — forked from reu/deploy.rb
# Bundler Integration
require "bundler/capistrano"
# Application Settings
set :application, "yourapplicationname"
set :user, "serveruser"
set :deploy_to, "/home/#{user}/rails-applications/#{application}"
set :rails_env, "production"
set :use_sudo, false
set :keep_releases, 3
@zires
zires / callbacks.js
Created October 9, 2013 14:12
You can use jquery events to create your own callbacks for timelineJS
$('#timeline-embed').delegate(".vco-timeline", "UPDATE", function () {
console.log('UPDATE', this);
});
$('#timeline-embed').delegate(".vco-timeline", "LOADED", function () {
console.log('LOADED', this);
});
$('#timeline-embed').delegate(".marker", "click", function () {
console.log('.marker', this);
upstream myapp {
server unix:///myapp/tmp/puma.sock;
}
server {
listen 80;
server_name myapp.com;
# ~2 seconds is often enough for most folks to parse HTML/CSS and
# retrieve needed images/icons/frames, connections are cheap in
@zires
zires / .irbrc
Created April 17, 2013 02:07
.irbrc
begin
require "pry"
Pry.start
exit
rescue LoadError => e
warn "=> Unable to load pry"
end
@zires
zires / ctags_rails
Created April 17, 2013 01:46
ctags rails
ctags -e --exclude=.git --exclude='*.log' -R * `bundle show --paths`
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
comment color
http://www.colorhexa.com/99968b
[user]
name =
email =
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
[color]
diff = auto