Skip to content

Instantly share code, notes, and snippets.

@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);
...
}
options = {:q=>'Starbucks', :category=>'Coffee & Tea', :radius=>5}
SimpleGeo::Client.get_places(37.772445, -122.405913, options)
@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
@l4u
l4u / gist:971938
Created May 14, 2011 05:06
amazon ses perl script
apt-get install libcrypt-ssleay-perl
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:969012
Created May 12, 2011 17:30
jruby ruby 1.9
export JRUBY_OPTS=--1.9
zh-TW:
errors:
messages:
not_found: "沒有找到"
already_confirmed: "已被確認過了"
not_locked: "被鎖定了"
not_saved:
one: "有一個錯誤導致%{resource}不能被儲存:"
other: "有 %{count} 個錯誤導致%{resource}不能被儲存:"
def shipping_country_name
shipping_address.try(:country).try(:name)
end
@l4u
l4u / ssh client config
Created January 20, 2011 03:17
edit ~/.ssh/config
Host _shorten_name_
User _ssh_user_
HostName _ssh_server_