Skip to content

Instantly share code, notes, and snippets.

View tmtk75's full-sized avatar

Tomotaka Sakuma tmtk75

View GitHub Profile
function App() {}
App.prototype.start = function(msg) {
console.log("started:", msg);
}
module.exports = App;
if (!module.parent) {
new App().start("app.js");
var App = require("./app");
new App().start("cli.js");
//http://go-tour-jp.appspot.com/#35
package main
import "code.google.com/p/go-tour/pic"
func f0(x, y int) uint8 {return uint8(x^y)}
func f1(x, y int) uint8 {return uint8((x+y)/2)}
func f2(x, y int) uint8 {return uint8(x*y)}
func Pic(dx, dy int) [][]uint8 {
package main
import (
"code.google.com/p/go-tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
m := make(map[string]int)
for _, a := range(strings.Fields(s)) {
@tmtk75
tmtk75 / a43.go
Last active December 19, 2015 12:39
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
a := []int{0, 1, 1}
i := 0
return func() int {
package main
import (
"fmt"
"math/cmplx"
)
func Cbrt(x complex128) complex128 {
z := complex(1, 0)
for i := 0; i < 10; i++ {
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
)
type MyImage struct{}
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
)
type MyImage struct{}
file {'testfile':
path => '/tmp/a',
ensure => present,
}
class vagrant {
include remote_file
include install
Class['vagrant::remote_file'] -> Class['vagrant::install']
}
$dmg_url = "http://files.vagrantup.com/packages/7ec0ee1d00a916f80b109a298bab08e391945243/Vagrant-1.2.7.dmg"
$node_vagrant_mount = "/Users/tsakuma/Vagrant-1.2.7.dmg"