Skip to content

Instantly share code, notes, and snippets.

View hysios's full-sized avatar
🎯
Focusing

hysios hysios

🎯
Focusing
View GitHub Profile
@hysios
hysios / AjaxAuth
Created January 16, 2013 07:40
AjaxAuth
// client = new AjaxAuthClient({
//
// })
// AjaxAuth.registerDialog(function(element){
// $(element)
// .appendTo('body')
// .addClass('center_model')
// .width(400)
@hysios
hysios / rails_console
Created May 24, 2012 07:02
install production rails console
yum install readline-devel
rvm pkg install readline
rvm reinstall 1.9.2 --with-readline-dir=$rvm_path/usr
cd /var/www/neza/current
bundle exec rails c production
echo export POW_TIMEOUT=10000 >> ~/.powconfig
echo export POW_WORKERS=3 >> ~/.powconfig
powpid=$(ps -eaf|grep pow |grep -v grep |awk '{print $2}')
echo "kill $powpid"
sudo kill $powpid
export POW_TIMEOUT=10000
export POW_WORKERS=3
export POW_TIMEOUT=10000
export POW_WORKERS=3
export POW_TIMEOUT=10000
export POW_WORKERS=3
export POW_TIMEOUT=10000
export POW_WORKERS=3
wrapError = (onError, model, options) ->
(resp) ->
if onError?
onError(model, resp, options);
else
model.trigger('error', model, resp, options)
apply: (name = null, options = {}) ->
name ||= @get('name')
success = options.success
wrapError = (onError, model, options) ->
(resp) ->
if onError?
onError(model, resp, options);
else
model.trigger('error', model, resp, options)
apply: (name = null, options = {}) ->
name ||= @get('name')
success = options.success
ni hao a