Skip to content

Instantly share code, notes, and snippets.


Lecky Lao leckylao

View GitHub Profile
leckylao / gist:365348
Created Apr 14, 2010
Rails CMS alternatives
View gist:365348
Rails CMS alternatives
Note: project activity was checked on 11/26/09 for most of these projects, and the "last update" field has not been kept up to date since then.
Active projects:
Last update: 11/24/09
View gist:459443
:year => '1i',
:month => '2i',
:day => '3i',
:hour => '4i',
:minute => '5i'
def select_date(date_to_select, options={})
date = date_to_select.is_a?(Date) || date_to_select.is_a?(Time) ?
leckylao / gist:459447
Created Jul 1, 2010
Cucumter select datetime
View gist:459447
# ripped from
module Cucumber
module Rails
module CapybaraSelectDatesAndTimes
def select_date(field, options = {})
date = Date.parse(options[:with])
within(:xpath, Capybara::XPath.fieldset(field).append(%Q{//p[label[contains(., "#{field}")]]})) do
find(:xpath, '//select[contains(@id, "_1i")]').select(date.year)
View inception-javascript.js
* Fabrizio Calderan, twitter @fcalderan, 2010.11.02
* I had an idea: could Inception movie be explained by a few javascript closures
* and variable resolution scope (just for fun)?
* Activate javascript console =)
<script>"inception movie");
leckylao / nginx
Created Jun 19, 2011 — forked from thewebfellas/nginx
init script for nginx
View nginx
#! /bin/sh
# Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and
# run 'sudo update-rc.d nginx defaults', or use the appropriate command on your
# distro.
# Author: Ryan Norbauer <>
# Modified: Geoffrey Grosenbach
View .vimrc
" Vundle
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# torquebox
export TORQUEBOX_HOME=~/torquebox-2.1.2
View .tmux.conf
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
View makelookuptag
# generate tag file for lookupfile plugin
echo -e "!_TAG_FILE_SORTED\t2\t/2=foldcase/" > filenametags
find . -not -regex '.*\.\(png\|gif\|csv\|jpg\|jpeg\|html\)' -not -regex '\./db/migrate/.*' -not -regex '\./\.git/.*' -not -regex '\./\.escm/.*' -not -regex '\./.*\.escm_ignore' -not -regex '\./.*\.svn.*' -not -regex '\./report/.*' -type f -printf "%f\t%p\t1\n" | \
sort -f >> filenametags
View .gitconfig
autocrlf = false
editor = gvim
ui = auto
st = status
ci = commit
br = branch
co = checkout