Skip to content

Instantly share code, notes, and snippets.

@l4u
l4u / ssh client config
Created January 20, 2011 03:17
edit ~/.ssh/config
Host _shorten_name_
User _ssh_user_
HostName _ssh_server_
def shipping_country_name
shipping_address.try(:country).try(:name)
end
zh-TW:
errors:
messages:
not_found: "沒有找到"
already_confirmed: "已被確認過了"
not_locked: "被鎖定了"
not_saved:
one: "有一個錯誤導致%{resource}不能被儲存:"
other: "有 %{count} 個錯誤導致%{resource}不能被儲存:"
@l4u
l4u / gist:969012
Created May 12, 2011 17:30
jruby ruby 1.9
export JRUBY_OPTS=--1.9
INFO: Starting Servlet Engine: Apache Tomcat/7.0.11
May 14, 2011 1:43:30 AM org.apache.catalina.startup.ContextConfig webConfig
INFO: No global web.xml found
May 14, 2011 1:43:33 AM org.apache.catalina.core.ApplicationContext log
INFO: Info: received max runtimes = 1
May 14, 2011 1:43:33 AM org.apache.catalina.core.ApplicationContext log
INFO: jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-12 85838f6) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24) [linux-amd64-java]
May 14, 2011 1:43:52 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-3000"]
@l4u
l4u / gist:971938
Created May 14, 2011 05:06
amazon ses perl script
apt-get install libcrypt-ssleay-perl
@l4u
l4u / vim solarized in iTerm2
Created August 5, 2011 03:35
vim solarized in iTerm2
# .profile
export TERM=xterm-256color
# .vimrc
syntax on
set background = dark
let g:solarized_termcolors = 256
colorscheme solarized
options = {:q=>'Starbucks', :category=>'Coffee & Tea', :radius=>5}
SimpleGeo::Client.get_places(37.772445, -122.405913, options)
@l4u
l4u / gist:1256288
Created October 1, 2011 16:36
cocos2d-x prevent touch propagation to other layers
// UpdateLayer.cpp
// prevent touch propagation to other layers
// cocos2d-1.0.1-x-0.9.1
void UpdateLayer::onEnter()
{
CCLayer::onEnter();
CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this, 0, true);
...
}
@l4u
l4u / gist:1257632
Created October 2, 2011 17:00
cocos2d-x userDefault crashes on Android
10-03 00:54:30.423: INFO/DEBUG(30): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-03 00:54:30.423: INFO/DEBUG(30): Build fingerprint: 'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys'
10-03 00:54:30.423: INFO/DEBUG(30): pid: 316, tid: 325 >>> org.cocos2dx.tests <<<
10-03 00:54:30.433: INFO/DEBUG(30): signal 11 (SIGSEGV), fault addr deadbaad
10-03 00:54:30.433: INFO/DEBUG(30): r0 00000000 r1 0000000c r2 00000027 r3 00000000
10-03 00:54:30.433: INFO/DEBUG(30): r4 00000000 r5 deadbaad r6 00001728 r7 00000000
10-03 00:54:30.433: INFO/DEBUG(30): r8 48218d84 r9 4185af14 10 4185af00 fp 00236d70
10-03 00:54:30.433: INFO/DEBUG(30): ip ffffffff sp 48218a48 lr afd154c5 pc afd11dc4 cpsr 40000030
10-03 00:54:30.523: INFO/DEBUG(30): #00 pc 00011dc4 /system/lib/libc.so