This script enables you to launch your Rails application in production environment (port:80) with Nginx and Unicorn.
Please make sure that your Gemfile in your rails application includes unicorn.
after "deploy:symlink", "deploy:restart_workers" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
// g++ simple.cpp -shared -o libsimple.dylib | |
#include <stdio.h> | |
class Simple { | |
int id_; | |
public: | |
Simple(int id); | |
~Simple(); |
-- luajit simple_jit.lua | |
ffi = require 'ffi' | |
simple = ffi.load('simple') | |
ffi.cdef[[ | |
typedef struct Simple Simple; | |
Simple *Simple_Simple(int); | |
void Simple__gc(Simple *); |
.gist-highlight { | |
border-left: 3ex solid #eee; | |
position: relative; | |
} | |
.gist-highlight pre { | |
counter-reset: linenumbers; | |
} | |
.gist-highlight pre div:before { |
# General configuration. | |
# $ tmux show-options -g | |
set -g base-index 1 | |
set -g display-time 5000 | |
set -g repeat-time 1000 | |
set -g status-keys vi | |
set -g status-utf8 on | |
set -g status-bg black | |
set -g status-fg white | |
set -g status-justify left |
var HoganExpressAdapter=(function(){ | |
var init=function(hogan) { | |
var compile=function(source){ | |
return function(options) { | |
return hogan.compile(source).render(options); | |
}; | |
} | |
return {compile:compile}; | |
}; | |
return {init:init}; |
var express=require('express'), | |
hogan=require('hogan.js'), | |
adapter=require('./hogan-express.js'), | |
app = express.createServer(); | |
app.configure(function(){ | |
app.use(express.static(__dirname + '/public')); | |
app.use(express.logger()); | |
app.use(express.bodyParser()); | |
app.use(express.cookieParser()); |
### INSTALLATION NOTES ### | |
# 1. Install Homebrew (https://github.com/mxcl/homebrew) | |
# 2. brew install zsh | |
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh) | |
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace | |
# 5. Install iTerm2 | |
# 6. In iTerm2 preferences for your profile set: | |
# Character Encoding: Unicode (UTF-8) | |
# Report Terminal Type: xterm-256color | |
# 7. Put itunesartist and itunestrack into PATH |
local ffi = require("ffi") | |
ffi.cdef[[ | |
typedef void (*cb)(void); | |
void call(int n, void (*)(void)); | |
void loop(int n); | |
void func(void); | |
]] | |
local callback = ffi.load("./callback.so") | |
local timeit = require("timeit") |