Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Lecky Lao leckylao

🎯
Focusing
View GitHub Profile
@leckylao
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:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
View gist:459443
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 Jul 1, 2010
Cucumter select datetime
View gist:459447
# 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)
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>
console.group("inception movie");
@leckylao
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 <ryan.norbauer@gmail.com>
# Modified: Geoffrey Grosenbach http://topfunky.com
#
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
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
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
#!/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
View .gitconfig
[core]
autocrlf = false
editor = gvim
[color]
ui = auto
[alias]
st = status
ci = commit
br = branch
co = checkout