Skip to content

Instantly share code, notes, and snippets.

View t7y's full-sized avatar
🏠
Working from home

Jerry Tian t7y

🏠
Working from home
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
@t7y
t7y / install-redis.sh
Last active December 26, 2015 14:19 — forked from dstroot/install-redis.sh
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.github.com/contentdj/7164925/raw/ca153f3ad5325ba6eb59ce2db7a5125d64569200/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
# config/initializers/redcarpet.rb
class ActionView::Template
class Redcarpet < Handler
include Handlers::Compilable
def compile template
::Redcarpet.new(template.source).to_html.inspect
end
end
@t7y
t7y / install-ruby-debug-ruby-1.9.3.sh
Created April 27, 2012 21:07 — forked from rmoriz/install-ruby-debug-ruby-1.9.3.sh
ruby-debug in ruby-1.9.3-p194 and rbenv
#!/bin/bash
cd /tmp
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/74596/ruby_core_source-0.1.5.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
wget http://rubyforge.org/frs/download.php/63094/ruby-debug19-0.11.6.gem
export RBENV_INCLUDE=$HOME/.rbenv/versions/1.9.3-p194/include/ruby-1.9.1/ruby-1.9.3-p194
gem install archive-tar-minitar
@t7y
t7y / postfromgooglereader.rb
Created September 12, 2011 18:52 — forked from danwoolley/postfromgooglereader.rb
Post from Google Reader to Wordpress blog
#!/usr/local/bin/ruby
# Get from your personal Google Reader public share.
# Post to your WordPress blog.
# Written by Dan Woolley on 9/8/07 for http://tzetzefly.com
# Command line: ruby postfromgooglereader.rb <post_type> <days_back>
# where <post_type> is 'draft', 'live', or 'test' (default is draft)
# and <days_back> is number of days back to get from Google Reader (default is 1)