Skip to content

Instantly share code, notes, and snippets.

View linyows's full-sized avatar

Tomohisa Oda linyows

View GitHub Profile
@tj
tj / routes.js
Created October 15, 2011 00:23
Express routes
var app = require('../app');
console.log();
app.routes.all().forEach(function(route){
console.log(' \033[90m%s \033[36m%s\033[0m', route.method.toUpperCase(), route.path);
});
console.log();
process.exit();
@shapeshed
shapeshed / unicorn
Created September 16, 2011 10:12
Unicorn / Monit setup
#!/bin/sh
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/path/to/your/app/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENVIRONMENT=production
@dandorman
dandorman / fabrication_feature_pool_spec.rb
Created August 9, 2011 23:00
FactoryGirl vs. Fabrication
require 'spec_helper'
describe FeaturePool do
it "creates a new instance given valid attributes" do
Fabricate :feature_pool
end
it "is not valid without a name" do
Fabricate.build(:feature_pool, :name => "").should_not be_valid
end
@kyanny
kyanny / diff-A.txt
Created June 28, 2011 13:13
git diff --diff-filter option
.../test/fixtures/test/scoped_translation.erb | 1 +
actionpack/test/fixtures/test/translation.erb | 1 +
.../test/connections/jdbc_jdbcderby/connection.rb | 18 ++++++++
.../test/connections/jdbc_jdbch2/connection.rb | 18 ++++++++
.../test/connections/jdbc_jdbchsqldb/connection.rb | 18 ++++++++
.../test/connections/jdbc_jdbcmysql/connection.rb | 26 +++++++++++
.../connections/jdbc_jdbcpostgresql/connection.rb | 26 +++++++++++
.../connections/jdbc_jdbcsqlite3/connection.rb | 25 ++++++++++
.../test/connections/native_db2/connection.rb | 25 ++++++++++
.../test/connections/native_firebird/connection.rb | 26 +++++++++++
@heisters
heisters / Solarized High Contrast Dark.itermcolors
Created June 8, 2011 21:49
Solarized High Contrast Dark theme for iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
@hotchpotch
hotchpotch / cocproxy.nginx.conf
Created May 25, 2011 04:50
cocproxy for nginx
#!nginx -p . -c cocproxy.nginx.conf
error_log /dev/stderr debug;
daemon off;
events {
worker_connections 48;
}
http {
class ApplicationController < ActionController::Base
...
# FORCE to implement content_for in controller
def view_context
super.tap do |view|
(@_content_for || {}).each do |name,content|
view.content_for name, content
end
end
end
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@justincormack
justincormack / nginx.conf
Created April 29, 2011 14:57
Using Lua and Nginx to proxy Amazon web services example
# example location parts of nginx.conf
# add your own AWS keys, server lines etc, and set your aws domains, paths
http {
# you will need the luacrypto in the cpath, download from http://luacrypto.luaforge.net/
lua_package_cpath "/home/justin/lua/luacrypto-0.2.0/src/l?.so.0.2.0;;";
server {
listen 80;
@atestu
atestu / gist:887268
Created March 25, 2011 17:53
Sends socket.io messages to the server writing on the S3 account using the knox library for node.js
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Alexandre Testu">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>