Skip to content

Instantly share code, notes, and snippets.

View umisama's full-sized avatar

umisama @ Takaaki IBARAKI umisama

  • Takaaki IBARAKI Office
  • Tokyo JPN
View GitHub Profile
@umisama
umisama / game.py
Last active July 11, 2017 00:31
knight of the round square
import random
START = "★"
NOMARK = "□"
MARKED = "■"
POSITION = "◎"
class Game:
def __init__(self, X=4, Y=4):
random.seed()
@umisama
umisama / without_for.go
Last active February 8, 2017 06:52
Fizz Buzz
package main
import (
"fmt"
)
const MAX = 100
func fb(num int) {
out := ""
@umisama
umisama / dbtest.go
Created December 18, 2015 12:46
document database prototype
package docdb
import (
"bytes"
"encoding/json"
"fmt"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
"reflect"
"strconv"
@umisama
umisama / shell
Created February 19, 2015 11:34
twitter client with peco
$ ID=$(twurl "/1.1/statuses/home_timeline.json?count=200" | jq ".[]|{user:.user.name, text ,id_str}" --compact-output | peco | jq ".id_str") && echo "-X POST /1.1/favorites/create.json?id=$ID" | xargs twurl
@umisama
umisama / README.md
Last active August 29, 2015 14:15
testing.Short() returns unexpected value on testing.TestMain(*testing.M). (https://github.com/golang/go/issues/9825)

This repo showing testing.Short() returns unexpected value on testing.TestMain(*testing.M).
please do go test -short.

Here is result in my environment

$ go version
go version go1.4 linux/amd64
$ go test -short
false   on TestMain
true on TestSomething
@umisama
umisama / background.js
Created August 11, 2014 12:30
[chrome extension]getting default font setting
"use strict";
(function() {
var families = ["standard", "sansserif", "serif", "fixed", "cursive", "fantasy"]
var families
families.forEach(function(val){
chrome.fontSettings.getFont({
genericFamily: val
}, function(details) {
@umisama
umisama / genmai_fail_on_float64.go
Last active August 29, 2015 14:00
genmai panic on select query with genmai.Float64.
package main
import (
"fmt"
_ "github.com/mattn/go-sqlite3"
"github.com/umisama/genmai"
)
type TestData struct {
Xxx genmai.Float64