Skip to content

Instantly share code, notes, and snippets.

View he9lin's full-sized avatar

Lin He he9lin

View GitHub Profile
@he9lin
he9lin / gist:2054587
Created March 17, 2012 02:55 — forked from JakubOboza/gist:2008958
faye as subdomain
upstream faye {
server 127.0.0.1:9292;
}
upstream webrick{
server 127.0.0.1:3000;
}
server {
listen 80 default;
@he9lin
he9lin / deploy_rails_app_on_ubuntu.md
Created October 1, 2011 09:51
Setup Rails application production environment on Ubuntu

Setup Rails application production environment on Ubuntu

Add deploy user

ssh root@YOURDOMAIN
adduser deploy
visudo # Add deploy ALL=(ALL) ALL

Install necessary libraries

this.headers
this.active.find
this.active.outerHeight()
this.element
this.headers
.attr('role', 'tab')
// jQuery based CSS parser
// documentation: http://youngisrael-stl.org/wordpress/2009/01/16/jquery-css-parser/
// Version: 1.1
// Copyright (c) 2009 Daniel Wachsstock
// MIT license:
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
//http://bililite.com/blog/2008/08/05/namespaces-in-jquery/
(function($){
if ({}.__proto__){
// mozilla & webkit expose the prototype chain directly
$.namespace = function(name){
$.fn[name] = function namespace() { // insert this function in the prototype chain
this.__proto__ = arguments.callee;
return this;
};
puts Readline:HISTORY.entries.split("exit").last[0..-2].join("\n")
// $.widget is a factory to create jQuery plugins
// taking some boilerplate code out of the plugin code
function getter(namespace, plugin, method, args) {
function getMethods(type) {
var methods = $[namespace][plugin][type] || [];
return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
}
var methods = getMethods('getter'); //[ui][plugin_name][getter], all getter methods
if (args.length == 1 && typeof args[0] == 'string') {