Skip to content

Instantly share code, notes, and snippets.

View liwh's full-sized avatar
🎯
Focusing

robie lee liwh

🎯
Focusing
View GitHub Profile

Collection API安装文档

安装git

rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
yum install --enablerepo=webtatic git-core

安装rbenv和ruby

#!/bin/sh
/opt/mongodb/bin/mongod --config /opt/config/mongodb \
## --upgrade \ ##runs a database upgrade option if needed \
#!/bin/sh
/opt/mongodb/bin/mongod --config /opt/config/mongodb \
## --upgrade \ ##runs a database upgrade option if needed \
$redis.keys('lbs:*').map{|k|$redis.del k}
@liwh
liwh / gist:2858648
Created June 2, 2012 14:32 — forked from snatchev/gist:1316470
resque worker devise not eager loading
❷ > QUEUE=* rake resque:work --trace
** Invoke resque:work (first_time)
** Invoke resque:preload (first_time)
** Invoke resque:setup (first_time)
** Execute resque:setup
** Execute resque:preload
rake aborted!
No such file to load -- devise/confirmations_controller
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:306:in `rescue in depend_on'
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:301:in `depend_on'
@liwh
liwh / sequel + fiveruns-memcache-client
Created April 20, 2012 08:21 — forked from EppO/sequel + fiveruns-memcache-client
trying to cache sequel models in memcached
$ sequel postgres://mylogin:mypasswd@localhost/bddtest
Your database is stored in DB...
>> require 'memcache'
=> true
>> MemCache
=> MemCache
>> MemCache::VERSION
=> "1.5.0.1"
>> CACHE = MemCache.new("localhost")
=> MemCache: 1 servers, 1 buckets, ns: nil, ro: false
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OViRjbGFzc1xOU0NvbG9yU3BhY2VVTlNSR0KAAhAB
TxAkMC4yMDAwMDAwMDMgMC4yMDAwMDAwMDMgMC4yMDAwMDAwMDMA0hAREhNaJGNsYXNz
bmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hpdmVy
@liwh
liwh / gist:1569769
Created January 6, 2012 08:51
ios mvc design patten
Model: 代表你的应用程序是什么(不是怎么展现)
Controller: 控制你的Model怎么展现给用户(UI逻辑)
View: Controller的奴隶。。。
Model,Controller,View相互通讯的规则:
Controller可以直接和Model通信
Controller也可以直接和View通信
Model和View永远不能直接通信
@liwh
liwh / gist:1538878
Created December 30, 2011 09:06
xcode gitignore
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
@liwh
liwh / rest_api.md
Created November 7, 2011 07:12
API设计

验证方式

包含以下两种认证方式:

响应格式

JSON 和 XML,咱时只考虑支持JSON调用