Skip to content

Instantly share code, notes, and snippets.

View mackee's full-sized avatar

mackee mackee

  • KAYAC Inc.
  • Japan
View GitHub Profile
package mizar
import (
"testing"
)
type Table1 struct {
Id DBInteger `db:"id"`
Name DBVarchar `db:"name"`
Description DBVarchar
@mackee
mackee / gist:8e9dabc437976444073c
Last active August 29, 2015 14:23
list item in blockquote sample
  1. first
my $hogehoge = "barbar";
  1. second
@mackee
mackee / stopwatch.py
Created October 14, 2011 08:24
stopwatch decorater
import time
def stopwatch(self, wrapped):
def _wrapper(*args, **kwargs):
tic = time.time()
result = wrapped(*args, **kwargs)
toc = time.time()
doc = str(wrapped.__doc__).split("\n")[0]
print("[%s] %f[sec]" % (doc, toc - tic))
return result
@mackee
mackee / plugin.md
Last active September 29, 2015 09:31
Goにおけるpluginの実装について(in 1.5)

Goにおけるpluginについて

前提

  • ここでのplugin = dynamic loading
  • Goでは現在のところ動的ローディングがまっとうな方法では出来ない
  • 以下ではまっとうではない方法というのを説明する
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use feature qw/say/;
use Imager;
use Imager::AnimeFace;
use Getopt::Long;
@mackee
mackee / before
Last active October 11, 2015 05:38
go-sqlla's micro tunings
[- o -] $ go test -bench=.
PASS
BenchmarkSelect__Squirrel-4 100000 12914 ns/op
BenchmarkSelect__Sqlla-4 1000000 1455 ns/op
ok github.com/mackee/go-sqlla/_benchmark 2.946s
use strict;
use warnings;
use utf8;
use 5.014;
{
package MyApp::Dispatcher;
sub name { return 'Hogehoge' }
}
use strict;
use warnings;
use utf8;
use 5.014;
{
package MyApp::Dispatcher;
sub name { return 'Hogehoge' }
}
use strict;
use warnings;
use utf8;
use 5.014;
{
package MyApp::Dispatcher;
sub name { return 'Hogehoge' }
}
--- .maltsconfig 2012-10-22 04:46:19.000000000 +0900
+++ .maltsconfig.new 2012-10-22 05:14:17.000000000 +0900
@@ -13,5 +13,10 @@
module_camelized_path => qr/root/,
module_camelized_name => qr/root/,
},
+ database => {
+ files => [
+ 'lib/Natchan/DB.pm'