Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
in progress… |██ |

Jiayong Ou jou

💭
in progress… |██ |
View GitHub Profile
View gist:2834968
diff --git a/app/helpers/requirejs_helper.rb b/app/helpers/requirejs_helper.rb
index 8de6197..46822c7 100644
--- a/app/helpers/requirejs_helper.rb
+++ b/app/helpers/requirejs_helper.rb
@@ -52,7 +52,11 @@ module RequirejsHelper
# Generate digestified paths from the modules spec
paths = {}
- modules.each { |m| paths[m] = _javascript_path(m).sub /\.js$/,'' }
+ modules.each do |m|
@jou
jou / .gitignore
Created May 30, 2012
requirejs-rails-issue-53-testcase
View .gitignore
.bundle
db/*.sqlite3
log/*.log
tmp/
.sass-cache/
vendor/bundle/
public/assets/
View gist:465440
if ($.inArray('something_strange', neighbourhood) != -1) {
ghostbusters.call();
}
View markdown_watcher.js
/* Simple node.js script to automatically generate HTML from Markdown files whenever
* they are changed. Requires [node-glob][1]. TODO: Watch for new files.
*
* [1]: http://github.com/isaacs/node-glob
*/
var fs = require('fs'),
sys = require('sys'),
path = require('path'),
spawn = require('child_process').spawn,
glob = require('./glob').glob,
View base58.rb
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar
# 14 rue de Plaisance, 75014 Paris, France
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jou
jou / notifydone
Created Feb 17, 2009
Run command and notify by growl when done
View notifydone
#!/bin/bash
# Requires growlnotify from Growl extras
"$@"
/usr/bin/env echo "$@" | growlnotify -s "Command completed"
View gist:49950
jou@kozue:~$ curl -I http://srs.li/
HTTP/1.1 200 OK
Date: Wed, 21 Jan 2009 11:45:14 GMT
Server: Apache/2
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.0.3, Things and Stuff, and The Infinite Improbability Drive
X-O-RLY: YA RLY!
Content-Type: text/html; charset=UTF-8
View gist:29463
# set variables for git prompt
set_current_git_branch(){
CURRENT_GIT_BRANCH=`git branch 2>/dev/null | grep '* ' | sed s/'* '//` ;
GIT_BRANCH_TEXT=''
GIT_BRANCH_COLOR=''
if [[ $CURRENT_GIT_BRANCH ]]; then
GIT_BRANCH_TEXT="(git:$CURRENT_GIT_BRANCH) "
GIT_BRANCH_COLOR="\[\033[01;31m\]"
fi