Skip to content

Instantly share code, notes, and snippets.

View smagch's full-sized avatar
🗾
Hokkaido

Shimaguchi Tomoya smagch

🗾
Hokkaido
View GitHub Profile
We couldn’t find that file to show.
@smagch
smagch / error.txt
Created May 16, 2014 07:33
Heroku Go Error
Initializing repository, done.
Counting objects: 185, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (174/174), done.
Writing objects: 100% (185/185), 31.05 KiB | 0 bytes/s, done.
Total 185 (delta 108), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Go app detected
-----> Installing go1.2.2... done
@smagch
smagch / circle.html
Last active August 29, 2015 14:03
pixi.js spike
<!doctype html>
<html>
<head>
<title>Clustermap</title>
<script type="text/javascript" src="pixi.js"></script>
</head>
<body>
<script type="text/javascript">
// It works with pixi.js 1.6
@smagch
smagch / construct.js
Last active August 29, 2015 14:04
Extreme Example of an URI
// I want to construct an URI for a project that a user created.
function getProjectURI(userName, projectName, q) {
return '/users/' + encodeURIComponent(userName)
+ '/projects/' + encodeURIComponent(projectName)
+ '?' + q;
}
function getProjectFragmentURI(userName, projectName, q) {
return '?' + q
+ '#!/users/' + encodeURIComponent(userName)
@smagch
smagch / main.go
Last active August 29, 2015 14:04
Go: middleware test
package main
import (
"errors"
"log"
"net/http"
)
type Handler interface {
ServeHTTPContext(w http.ResponseWriter, r *http.Request, c *Context)
@smagch
smagch / README.md
Last active August 29, 2015 14:05
Postgres time shcedule schema

Time Schedule SQL schema

A user can't add days, an event entry unless there isn't an overlap in start_time and end_time span.

@smagch
smagch / README.md
Last active August 29, 2015 14:05
FOAFでの自分のプロフィール
We couldn’t find that file to show.
package main
import (
"encoding/json"
"fmt"
"log"
"strings"
)
type Role int
@smagch
smagch / null_int_64.go
Created October 6, 2014 12:29
Custom sql.NullInt64 that handles json marshalling nicely, http://play.golang.org/p/w8VzxLGd-f
package main
import (
"database/sql"
"encoding/json"
"errors"
"log"
"strconv"
)
@smagch
smagch / .dockerignore
Last active August 29, 2015 14:07
Link Docker container example between golang1.3.3-onbuild and postgres:9.3.5 with Docker v1.2.0
.git
README.md