Skip to content

Instantly share code, notes, and snippets.

@turadg
turadg / .htaccess
Created September 16, 2011 01:56
Rsync to CMU Andrew publishing and push to publish
RewriteEngine on
# match any directory
RewriteCond %{REQUEST_FILENAME} -d
# redirect somewhere instead of serving it
RewriteRule ^(.*)$ http://www.cs.cmu.edu/~taleahma/ [R,NC,L]
@turadg
turadg / gist:941550
Created April 26, 2011 00:35
Shim for HTML5 number input type
/* Requires:
* Modernizr <http://www.modernizr.com/>
* JQuery Numeric <http://www.texotela.co.uk/code/jquery/numeric/>
*/
// require numeric input even when HTML5 not available
if (!Modernizr.inputtypes.number) {
// no native support for <input type="number">
$("input[type=number]").numeric(false, function() { alert("Integers only"); this.value = ""; this.focus(); });
}
@turadg
turadg / rake.sh
Created February 23, 2011 16:28
Bash completion for ruby Rake
# bash completion for rake
#
# some code from on Jonathan Palardy's http://technotales.wordpress.com/2009/09/18/rake-completion-cache/
# and http://pastie.org/217324 found http://ragonrails.com/post/38905212/rake-bash-completion-ftw
#
# For details and discussion
# http://turadg.aleahmad.net/2011/02/bash-completion-for-rake-tasks/
#
# INSTALL
#
effuse-hcii-cs-cmu-edu:~ taleahma$ brew install gource
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
######################################################################## 100.0%
==> ./configure --with-pc-path=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig --disable-debug --
==> make install
/usr/local/Cellar/pkg-config/0.23: 7 files, 220K, built in 38 seconds
==> Downloading http://www.libsdl.org/release/SDL-1.2.14.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/sdl/1.2.14 --disable-debug --disable-dependency-tracking --disable-nasm
==> make install