Skip to content

Instantly share code, notes, and snippets.

View mattn's full-sized avatar
🍛
I love curry 🍛

mattn mattn

🍛
I love curry 🍛
View GitHub Profile
{
"argv": [
"python",
"c:/Users/mattn/AppData/Roaming/jupyter/kernels/vimkernel/vimkernel.py",
"-f",
"{connection_file}"
],
"display_name": "Vim"
}
@mattn
mattn / main.go
Created December 12, 2018 16:57
go-libvterm を使ったサンプル
package main
import (
"image"
"image/color"
"image/draw"
"image/png"
"log"
"os"
@mattn
mattn / Makefile
Last active November 13, 2018 16:15
SRCS = \
pow.c
OBJS = $(subst .c,.o,$(SRCS))
CFLAGS = -fPIC
LIBS = -shared -lm -ldl
TARGET = libpow.so
.SUFFIXES: .c .o
@mattn
mattn / fizzbuzz.go
Last active November 3, 2018 03:27
learn FizzBuzz with gobrain
package main
import (
"math/rand"
"github.com/goml/gobrain"
)
type FizzBuzz []float64
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
)
@mattn
mattn / pennywize.srt
Last active October 21, 2018 06:41
1
00:00:08,0 --> 00:00:10,0
あぁ!僕のテキストファイルが!
2
00:00:18,300 --> 00:00:19,500
ハーイ、ジョージィ!
3
00:00:23,0 --> 00:00:25,0
FROM golang:1.9-alpine as base
WORKDIR /usr/src
COPY . .
RUN apk add git
RUN CGO_ENABLED=0 go get -d -ldflags "-s -w" .
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o main
FROM scratch
COPY --from=base /usr/src/main /go-http-microservice
CMD ["/go-http-microservice"]
<html>
<head>
<title>Testing WebAssembly</title>
<script src="wasm_exec.js"></script>
<script type="text/javascript">
function fetchAndInstantiate(url, importObject) {
return fetch(url).then(response =>
response.arrayBuffer()
).then(bytes =>
WebAssembly.instantiate(bytes, importObject)
// +build ignore
package main
func add(a, b int) int {
return a + b
}
func main() {
}
// +build ignore
package main
func add(a, b int) int {
return a + b
}
func main() {
}