Skip to content

Instantly share code, notes, and snippets.

View larryzhao's full-sized avatar
🐱
Meow

Larry Zhao larryzhao

🐱
Meow
View GitHub Profile
@larryzhao
larryzhao / Capfile
Created June 27, 2012 16:29
Bundler::GemNotFound: Could not find rake-0.9.2.2 in any of the sources
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
@larryzhao
larryzhao / deploy.rb
Created June 27, 2012 09:52 — forked from bkutil/deploy.rb
Start and Stop tasks for resque workers and resque scheduler with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
after "deploy:restart_workers", "deploy:restart_scheduler"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
@larryzhao
larryzhao / ie9_bug.js
Created June 17, 2012 15:11
IE9 bug reproduction
function func1(flag){
if(flag){
alert("Caller is here!");
}else {
func2();
}
}
function func2(){
arguments.callee.caller(true);
@larryzhao
larryzhao / error
Created May 30, 2012 12:19
torquebox launch error when using zip install
$ $JBOSS_HOME/bin/standalone.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /opt/web/torquebox-current/jboss
JAVA: java
JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml -Xss2048k
@larryzhao
larryzhao / error
Created May 30, 2012 03:58
Permission denied error when `rvm get stable`
$ rvm get stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 185 100 185 0 0 441 0 --:--:-- --:--:-- --:--:-- 1456
100 9249 100 9249 0 0 8117 0 0:00:01 0:00:01 --:--:-- 8117
Downloading RVM from wayneeseguin branch stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 125 100 125 0 0 140 0 --:--:-- --:--:-- --:--:-- 174
100 1045k 100 1045k 0 0 304k 0 0:00:03 0:00:03 --:--:-- 440k
@larryzhao
larryzhao / ls -ld rvm_path
Created May 29, 2012 16:51
Output of installing rvm system widely
$ ls -ld $rvm_path/*
-rw-rw-r-- 1 root rvm 566 May 30 00:54 /usr/local/rvm/LICENCE
-rw-rw-r-- 1 root rvm 8662 May 30 00:54 /usr/local/rvm/README
-rw-rw-r-- 1 root rvm 7 May 30 00:54 /usr/local/rvm/RELEASE
-rw-rw-r-- 1 root rvm 7 May 30 00:54 /usr/local/rvm/VERSION
drwxrwsr-x 2 root rvm 4096 May 30 00:43 /usr/local/rvm/archives
drwxrwsr-x 2 root rvm 4096 May 30 00:54 /usr/local/rvm/bin
drwxrwsr-x 2 root rvm 4096 May 30 00:54 /usr/local/rvm/config
drwxrwsr-x 3 root rvm 4096 May 30 00:15 /usr/local/rvm/contrib
drwxrwsr-x 2 root rvm 4096 May 30 00:45 /usr/local/rvm/environments
@larryzhao
larryzhao / Capfile.rb
Created May 28, 2012 06:07
uninitialized constant Capistrano in rvm-capistrano
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
@larryzhao
larryzhao / spec result
Created March 26, 2012 09:58
twitter-text-rb extractor spec
Twitter::Extractor
mentions
should accept a block arugment and call it in order
single screen name alone
should be linked
should be linked with _
should be linked if numeric
multiple screen names
should both be linked
screen names embedded in text
$ jruby json_text.rb
["に到着を待っている"] is in encoding: UTF-8
に到着を待っている is in encoding ASCII-8BIT
@larryzhao
larryzhao / gist:2044425
Created March 15, 2012 14:21
directly cap deploy:start
$ /usr/local/rvm/gems/jruby-1.6.7@global/gems/torquebox-server-2.0.0.cr1-java/jboss/bin/standalone.sh -b 0.0.0.0
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /usr/local/rvm/gems/jruby-1.6.7@global/gems/torquebox-server-2.0.0.cr1-java/jboss
JAVA: java
JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml