Skip to content

Instantly share code, notes, and snippets.

@lentg
lentg / nginx.conf
Last active August 29, 2015 14:06 — forked from turtlesoupy/nginx.conf
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@lentg
lentg / 0.rb
Created March 2, 2013 09:06
list dir
path = "C:/Documents and Settings/Administrator/mypg/public"
def traverse_dir(file_path)
if File.directory? file_path
Dir.foreach(file_path) do |file|
if file!="." and file!=".."
traverse_dir(file_path+"/"+file)
end
end
@lentg
lentg / 0.rb
Created March 2, 2013 08:58
获取目录下的所有文件
path = "C:/Documents and Settings/Administrator/mypg/public"
def traverse_dir(file_path)
if File.directory? file_path
Dir.foreach(file_path) do |file|
if file!="." and file!=".."
traverse_dir(file_path+"/"+file){|x| yield x}
end
end
@lentg
lentg / app.js.coffee
Created December 4, 2012 14:34 — forked from doitian/app.js.coffee
JS Start Entry. Solution 3 Sample for http://ruby-china.org/topics/7145
class App
constructor: (@body) ->
# site global setup
start: ->
controllerName = @body.data('js_controller')
Controller = App[controllerName]
if Controller
@main = new Controller
@lentg
lentg / install.sh
Created November 30, 2012 04:04 — forked from padcom/install.sh
Gitorious installation on Ubuntu 12.04
#!/bin/bash
#------------------------------------------------------------------------------
# SETTINGS
#------------------------------------------------------------------------------
MYSQL_ROOT_PASSWORD=password
MYSQL_GITORIOUS_PASSWORD=password
GITORIOUS_HOST=gitorious
SYSADMIN=sysadmin
@lentg
lentg / Procfile
Created October 6, 2012 18:17
procfile
web: unicorn -c config/unicorn.rb -E production
@lentg
lentg / gemfiles
Created October 6, 2012 18:16
gemfile
# source 'https://ruby.taobao.org'
source 'http://ruby.taobao.org'
gem 'rails', '3.2.8'
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end