Skip to content

Instantly share code, notes, and snippets.

@huyhong
huyhong / pangrams
Created September 7, 2013 00:56
List of Pangrams
Nymphs blitz quick vex dwarf jog. (27 letters)
DJs flock by when MTV ax quiz prog. (27 letters) (2 acronyms and a US spelling)
Big fjords vex quick waltz nymph. (27 letters)
Bawds jog, flick quartz, vex nymph. (27 letters)
Junk MTV quiz graced by fox whelps. (28 letters) (Includes proper noun)
Bawds jog, flick quartz, vex nymphs. (28 letters)
Waltz, bad nymph, for quick jigs vex! (28 letters)
Fox nymphs grab quick-jived waltz. (28 letters)
Brick quiz whangs jumpy veldt fox. (28 letters)
Glib jocks quiz nymph to vex dwarf. (28 letters)
@huyhong
huyhong / .powenv
Created August 18, 2013 12:18
.powenv inside rails projects
# detect `$rvm_path`
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
then rvm_path="${HOME:-}/.rvm"
fi
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
then rvm_path="/usr/local/rvm"
fi
# load environment of current project ruby
if
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
@huyhong
huyhong / .bash_profile
Created August 2, 2013 18:37
Martin's colored git branch & RVM/gemset .bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
bash_prompt() {
#git
local status=$(git status 2> /dev/null | grep 'working directory clean')
local dirty=''
if [ -z "$status" ]; then
local dirty='*'
fi
local branch=$(git branch 2> /dev/null | grep -e "\* " | sed "s/^..\(.*\)/\1/")
@huyhong
huyhong / box_shadow.sass
Created June 25, 2009 19:28
box-shadow CSS3 Sass mixin
// box-shadow CSS3 Sass mixin
// http://www.w3.org/TR/css3-background/#the-box-shadow
= box-shadow(!horizontal_offset = 10px, !vertical_offset = 10px, !blur_radius = 5px, !box_color = #000)
:-webkit-box-shadow = !horizontal_offset !vertical_offset !blur_radius !box_color
:-moz-box-shadow = !horizontal_offset !vertical_offset !blur_radius !box_color
:box-shadow = !horizontal_offset !vertical_offset !blur_radius !box_color