This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs"); | |
var readline = require("readline"); | |
var gapi = require("googleapis"); | |
var CLIENT_ID = "Your client id here"; | |
var CLIENT_SECRET = "Your client secert here"; | |
var REDIRECT_URL = "Your redirect url here"; | |
var SCOPE = "https://spreadsheets.google.com/feeds"; | |
var TOKENS_FILEPATH = "./tokens.json"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type task struct { | |
url string | |
result chan string | |
} | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hello | |
import ( | |
"github.com/codegangsta/martini" | |
"net/http" | |
) | |
func init() { | |
m := martini.Classic() | |
m.Get("/hello/:name", func(params martini.Params, w http.ResponseWriter) string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"flag" | |
"time" | |
) | |
type result struct { | |
seq int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
memcache.JSON.Add(c, &memcache.Item{Key:"test", Object: struct { | |
Name string | |
Address string | |
} { | |
"hoge", | |
"moke", | |
}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var json = JSON.stringify(data, function(key, value) { | |
if (value instanceof Object === false || Object.getPrototypeOf(value) !== Object.prototype) { | |
return value; | |
} | |
var keys = Object.keys(value); | |
keys.sort(); | |
var newValue = {}; | |
keys.forEach(function(key) { | |
newValue[key] = value[key]; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package data | |
type s struct { | |
a, b string | |
} | |
func NewS(a, b string) s { | |
return s{a, b} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test() { | |
var scope = angular.element(document.getElementById('test')).scope(); | |
scope.$apply(function() { | |
scope.test = 'this is test!!!'; | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tool | |
import ( | |
"bytes" | |
) | |
func Reverse(s string) string { | |
runes := make([]rune, 0, 10) | |
for _, r := range s { | |
runes = append(runes, r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package getmultitest | |
import ( | |
"appengine" | |
"appengine/datastore" | |
"fmt" | |
"net/http" | |
) | |
func init() { |
OlderNewer