roo document: roo
require 'rubygems'
require 'roo'
require 'json'
hash = {}roo document: roo
require 'rubygems'
require 'roo'
require 'json'
hash = {}| ; Comments start with semicolons. | |
| ; Clojure is written in "forms", which are just | |
| ; lists of things inside parentheses, separated by whitespace. | |
| ; | |
| ; The clojure reader assumes that the first thing is a | |
| ; function or macro to call, and the rest are arguments. | |
| ; | |
| ; Here's a function that sets the current namespace: | |
| (ns test) |
| class Dragon; end | |
| # 使用 def 定義 class method | |
| Dragon.instance_eval do | |
| def foo | |
| puts "bar" | |
| end | |
| end | |
| Dragon.foo # bar |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
| fork 了某个开源项目,发了PR后,需要更新master的代码的做法: | |
| git remote add --track master upstream git://github.com/upstreamname/projectname.git | |
| git fetch upstream | |
| git merge upstream/master | |
| 注意:upstream 是定义名称。 |
| class ApplicationController < ActionController::Base | |
| ... | |
| #Problem: | |
| #In rails 3.0.1+ it is no longer possible to do this anymore; | |
| # rescue_from ActionController::RoutingError, :with => :render_not_found | |
| # | |
| #The ActionController::RoutingError thrown is not caught by rescue_from. | |
| #The alternative is to to set a catch-all route to catch all unmatched routes and send them to a method which renders an error | |
| #As in http://techoctave.com/c7/posts/36-rails-3-0-rescue-from-routing-error-solution |
共同点在于:都有 ToUserName,FromUserName,CreateTime,MsgType, 这四个字段。
在信息接收方面,分为“普通消息”、“事件推送”,“语音识别结果(微信用户发送语音,微信服务器翻译成文本,只不过比语音消息多一个识别结果字段:Recognition)”。
Alt+F2 : 快速打开搜索栏。
Alt+Tab : 不同应用之间的切换,选中某一个,再Alt+~ 即可放大当前栏目。
下载了Sublime Text 之后,我们需要建立一个快捷命令
sudo mv Sublime\ Text\ 2 /opt/
sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime