Skip to content

Instantly share code, notes, and snippets.

View tmtk75's full-sized avatar

Tomotaka Sakuma tmtk75

View GitHub Profile
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
file, err := os.Open("file_Scanner.go")
package main
import (
"fmt"
"os"
)
func main() {
file, err := os.Open("file_read.go")
defer file.Close()
from fabric.api import env, run
env.use_ssh_config = True
def tail_message():
run("tail -f /var/log/message")
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"
file {'testfile':
path => '/tmp/a',
ensure => present,
}
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{}
package main
import (
"fmt"
"math/cmplx"
)
func Cbrt(x complex128) complex128 {
z := complex(1, 0)
for i := 0; i < 10; i++ {
@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 (
"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)) {