Skip to content

Instantly share code, notes, and snippets.

@kamichidu
kamichidu / driver.go
Created January 17, 2017 03:10
POC: golang database/sql, row to map[string]interface{} mapping
package main
import (
"database/sql"
"database/sql/driver"
"fmt"
"strings"
)
type Mapper interface {
package test
import (
"github.com/pkg/browser"
"io/ioutil"
"net/http"
"net/url"
"strings"
"sync"
"testing"
@kamichidu
kamichidu / gista-file
Created September 24, 2016 15:18
IC2 Miner research
Diamond Drill + OVScanner:
6 + 1 + 6の範囲を採掘
□ 採掘対象外
■ 採掘対象
☆ Miner
□□□□□□□□□□□□□□□
□■■■■■■■■■■■■■□
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Input box and delayed api calling example</title>
</head>
<body>
<input id="delay" type="text">
<script>
(function(){
@kamichidu
kamichidu / executor.js
Created June 28, 2016 05:11
js-executor
module.exports= (function(){
'use strict';
var Executor= function(opts){
opts || (opts= {});
this.nactives= opts.nactives || 10;
this.actives= [];
this.all= [];
};
@kamichidu
kamichidu / lingr-api-proxy.md
Last active February 24, 2016 02:50
Restructure memo for lingr api

lingr-api-proxy

LingrではREST APIの形式が雑なので、扱いやすいようにするためのAPI整形用Proxyを置いたほうが良い。 かつ、Lingrは不安定なことでも有名なので、中間にProxyを置き、Lingrとの直接通信をなくすことでクライアント側の実装が簡易となる。

Lingrは以下のAPIを提供している。

POST /session/create POST /session/verify POST /session/destroy

[maple@lady-grey kokoro-io]$ bundle exec rake db:setup
db/development.sqlite3 already exists
rake aborted!
URI::InvalidURIError: bad URI(is not URI?):
/home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/pusher-0.15.2/lib/pusher/client.rb:53:in `url='
/home/maple/sources/kokoro-io/config/initializers/pusher.rb:3:in `<top (required)>'
/home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
/home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
/home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
INFO : Starting Itamae...
INFO : Loading node data from /home/maple/sources/kokoro-io/itamae/nodes/vagrant.json...
/home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/itamae-1.9.0/lib/itamae/recipe.rb:130:in `include_recipe': Recipe not found. (rtn_rbenv::user) (Itamae::Recipe::NotFoundError)
from /home/maple/sources/kokoro-io/itamae/recipes/provision.rb:5:in `load'
from /home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/itamae-1.9.0/lib/itamae/recipe.rb:58:in `instance_eval'
from /home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/itamae-1.9.0/lib/itamae/recipe.rb:58:in `load'
from /home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/itamae-1.9.0/lib/itamae/runner.rb:49:in `block in load_recipes'
from /home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/itamae-1.9.0/lib/itamae/runner.rb:40:in `each'
from /home/maple/sources/kokoro-io/vendor/bundle/ruby/2.2.0/gems/itamae-1.9.0/lib/itamae/runner.rb:40:in `load_recipes'
Error detected while processing function neoclojure#complete#test..neoclojure#ns_declare..<SNR>162_consume_all_blocking..<SNR>162_is_done..<SNR>162_tick..<SNR>162_of..<SNR>162_tick..<SNR>162__read..<SNR>166_read_pipes..<SNR>166_read..<SNR>166_vp_pipe_read..<SNR>166_libcall_raw_read:
line 12:
E605: Exception not caught: vimproc: vp_pipe_read: 'PeekNamedPipe() error: 00000006 The handle is invalid.^M^@'
Error detected while processing function neoclojure#complete#test..neoclojure#ns_declare..<SNR>162_consume_all_blocking..<SNR>162_is_done..<SNR>162_tick..<SNR>162_of..<SNR>162_tick..<SNR>162__read..<SNR>166_read_pipes..<SNR>166_read:
line 12:
E170: Missing :endwhile
Error detected while processing function neoclojure#complete#test..neoclojure#ns_declare..<SNR>162_consume_all_blocking..<SNR>162_is_done..<SNR>162_tick..<SNR>162_of..<SNR>162_tick:
line 23:
E171: Missing :endif
Error detected while processing function neoclojure#complete#test..neoclojure#ns_declare..<SNR>162_consume_all_blocking..<SNR>162_is_d
@kamichidu
kamichidu / st
Created December 15, 2015 14:59
current startup time under mac yosemite
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.021 000.021: --- VIM STARTING ---
000.193 000.172: Allocated generic buffers
001.359 001.166: locale set
001.373 000.014: clipboard setup
001.388 000.015: window checked
002.190 000.802: inits 1