Skip to content

Instantly share code, notes, and snippets.

@congjf
congjf / Statements.markdown
Last active August 29, 2015 13:57
Golang Spec in Chinese

go

“go”语句会在一个独立的控制线程(或goroutine)中执行一个方法(在相同的地址究竟内部)。

GoStmt = "go" Expression .

expression表达式必须是一个方法或一个函数。内建方法被限制用于expression表达式。

@congjf
congjf / 1.sample.js
Last active August 29, 2015 13:56
AngularJS in Chrome Extension
// Call Chrome API
function MyController($scope){
chrome.bookmarks.getTree(function(tree){
// Here MUST use $scope.$apply() for Render the data updated to View.
$scope.$apply(function(){
$scope.tree = tree[0].children;
});
});
}
@congjf
congjf / .js
Last active August 29, 2015 13:56
AngularJS Tree
// app.js
angular.module("myApp", []).
controller("TreeController", ['$scope', function($scope) {
$scope.delete = function(data) {
data.nodes = [];
};
$scope.add = function(data) {
var post = data.nodes.length + 1;
var newName = data.name + '-' + post;
data.nodes.push({name: newName,nodes: []});
@congjf
congjf / .SimpleUse.go
Last active August 29, 2015 13:56
Termbox-Go using
package main
import (
"github.com/nsf/termbox-go"
"log"
)
func draw(ch rune) {
w, h := termbox.Size()
bg := termbox.ColorBlack
@congjf
congjf / .Title
Last active August 29, 2015 13:56
AngularJS Using Filter
AngularJS Using Filter
@congjf
congjf / .Title
Last active January 4, 2016 15:59
JavaScript GOF
JavaScript GOF
@congjf
congjf / .Title
Last active January 3, 2016 07:49
Algorithms using Golang
Algorithms using Golang
@congjf
congjf / .Title
Last active January 2, 2016 18:49
AngularJS Using Services
AngularJS Using Services
@congjf
congjf / .Title
Last active January 1, 2016 17:39
Javascript Buildin Object/Function
Javascript Buildin Object/Function
@congjf
congjf / .Title
Created December 26, 2013 01:34
Golang Static File Server
Golang Static File Server