Skip to content

Instantly share code, notes, and snippets.

View jou's full-sized avatar
💭
in progress… |██ |

Jiayong Ou jou

💭
in progress… |██ |
View GitHub Profile
# 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
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
@jou
jou / notifydone
Created February 17, 2009 13:27
Run command and notify by growl when done
#!/bin/bash
# Requires growlnotify from Growl extras
"$@"
/usr/bin/env echo "$@" | growlnotify -s "Command completed"
/* 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,
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|
if ($.inArray('something_strange', neighbourhood) != -1) {
ghostbusters.call();
}
@jou
jou / .gitignore
Created May 30, 2012 09:08
requirejs-rails-issue-53-testcase
.bundle
db/*.sqlite3
log/*.log
tmp/
.sass-cache/
vendor/bundle/
public/assets/
# 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