【成都社区活动】 NodeSchool Workshop 六月七号(周六)
NodeJS 是现在最热门的 JavaScript 后端框架。你对 NodeJS 有兴趣但一直没机会深度接触吗?
- 你是前端或者移动端开发,想学写简单的后台服务
- 你是后台开发,想尝试用异步框架写高并发服务
- 你是学生,想学些学校没教的新技术,想认识社区的一些牛人
[ | |
{ | |
"id": "1978774765", | |
"type": "PushEvent", | |
"actor": { | |
"id": 382747, | |
"login": "andrepl", | |
"gravatar_id": "411d2b4791a8de51f98666e93e9f1fde", | |
"url": "https://api.github.com/users/andrepl", | |
"avatar_url": "https://gravatar.com/avatar/411d2b4791a8de51f98666e93e9f1fde?d=https%3A%2F%2Fa248.e.akamai.net%2Fassets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png&r=x" |
# In Ruby, you can always pass a block to a method call. | |
def foo | |
end | |
# Call foo with a block, but foo just ignores the block | |
foo { puts "doesn't call the block" } | |
# foo can capture the block |
require "active_support/callbacks" | |
class Foo | |
include ActiveSupport::Callbacks | |
define_callbacks :foo | |
set_callback :foo, :around, :around_1 | |
set_callback :foo, :before, :before_1 | |
set_callback :foo, :after, :after_1 |
__extends = function(child, parent) { | |
for (var key in parent) { | |
if (__hasProp.call(parent, key)) child[key] = parent[key]; | |
} | |
function ctor() { | |
// why set the prototype's constructor to child? | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype; | |
child.prototype = new ctor; |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
type foo struct { | |
i int | |
} |
weibo = [...] # 所有转发的微博用户
email = [...] # 所有 v2ex 留帖的用户
all = weibo + email
# 随机选两个,打印
i = rand(all.length)
p all.delete_at(i)
i = rand(all.length)
(* | |
Set xcode window dimension | |
*) | |
set theApp to "Xcode6-Beta6" | |
set width to 1400 | |
set height to 900 |
// Compiler/SourceKit Bug in [6A1052c]: Omit the `[[Int]]` type annotation seems to trigger polynomial/exponential run-time in the type analyzer. | |
// 9 elements takes about a minute to compile on my low-end MBP. | |
private let gameLayouts: [[Int]] = [ | |
[0,0,0,0, | |
0,0,0,0, | |
0,1,1,0, | |
0,0,0,0, | |
0,0,0,0], | |
[0,0,0,0, |
// | |
// Card.swift | |
// MatchPairs | |
// | |
// Created by Howard Yeh on 2014-09-03. | |
// Copyright (c) 2014 Howard Yeh. All rights reserved. | |
// | |
import UIKit |