Skip to content

Instantly share code, notes, and snippets.

View leckylao's full-sized avatar
🎯
Focusing

Lecky Lao leckylao

🎯
Focusing
View GitHub Profile
@leckylao
leckylao / gist:365348
Created April 14, 2010 01:36
Rails CMS alternatives
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:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
@leckylao
leckylao / gist:459443
Created July 1, 2010 01:52
DateTime parser
DATE_TIME_SUFFIXES = {
: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
leckylao / gist:459447
Created July 1, 2010 01:54
Cucumter select datetime
# ripped from http://github.com/robholland/cucumber-rails/commit/10323c578906fe7a3ed2fdab090b7e326796b386
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)
/*
* 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>
console.group("inception movie");
@leckylao
leckylao / nginx
Created June 19, 2011 10:16 — forked from thewebfellas/nginx
init script for 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 <ryan.norbauer@gmail.com>
# Modified: Geoffrey Grosenbach http://topfunky.com
#
@leckylao
leckylao / .vimrc
Last active November 3, 2020 03:19
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
@leckylao
leckylao / .bashrc
Last active October 11, 2015 01:38
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
PATH=/usr/bin:/usr/local/bin:$PATH
# torquebox
export TORQUEBOX_HOME=~/torquebox-2.1.2
export JBOSS_HOME=$TORQUEBOX_HOME/jboss
export JRUBY_HOME=$TORQUEBOX_HOME/jruby
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
#!/bin/sh
# 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
[core]
autocrlf = false
editor = gvim
[color]
ui = auto
[alias]
st = status
ci = commit
br = branch
co = checkout