Skip to content

Instantly share code, notes, and snippets.

View hhatto's full-sized avatar
⛰️
enjoy

Hideo Hattori hhatto

⛰️
enjoy
View GitHub Profile
package main
import (
"fmt"
"log"
"github.com/clarkduvall/hyperloglog"
"github.com/dchest/siphash"
metro "github.com/dgryski/go-metro"
gohll "github.com/sasha-s/go-hll"
extern "C" {
pub fn otama_open(otama: *mut *mut otama_t,
config_path: *const ::std::os::raw::c_char)
-> otama_status_t;
}
@hhatto
hhatto / filter4gendarme.go
Created October 5, 2016 08:26
reconstruct gendarme xml
package main
import (
"encoding/xml"
"flag"
"fmt"
"io/ioutil"
"strings"
)
include header path: /usr/include/GraphicsMagick/
boost lib: boost_python
library path: /usr/lib64/libGraphicsMagick++
GraphicsMagick version: 1.3.23
running install
running bdist_egg
running egg_info
creating pgmagick.egg-info
writing pgmagick.egg-info/PKG-INFO
writing top-level names to pgmagick.egg-info/top_level.txt
@hhatto
hhatto / pprofsort.py
Last active January 10, 2016 13:53
sort of /debug/pprof/goroutine?debug=1
#!/usr/bin/env python
import sys
import re
import argparse
RE_STARTLINE = re.compile("[0-9]? @ 0x")
RE_STACKINFO_LINE = re.compile("#\t0x")
GOROUTINE_NUM_COLOR = 11
COLOR_LEVELS = [196, 202, 208, 214, 248, 250, 252]
@hhatto
hhatto / gist:8223007
Created January 2, 2014 17:43
replaced to CachedTokenizer
[no cached generate_tokenize]
$ make benchmark (git)-[master]
---> benchmark of autopep8.py test/example.py
1.34user 0.03system 0:01.42elapsed 96%CPU (0avgtext+0avgdata 9548maxresident)k
7240inputs+0outputs (24major+2916minor)pagefaults 0swaps
---> benchmark of test_unit
...........................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 331 tests in 44.265s
@hhatto
hhatto / gist:7548246
Last active December 28, 2015 19:09
MacOSX10.8.5 Python2.7.6 (from brew) use compiler Cython0.19.2
$ gdb python
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .... done
(gdb) r tests/hoedown_test.py
"
" Fruity Color Scheme
" ===================
"
" Author: Armin Ronacher <armin.ronacher@active-4.com>
" Version: 0.2
"
set background=dark
hi clear
@hhatto
hhatto / fixmake.vim
Last active December 22, 2015 00:49
check invalid Go source format with vim
" ~/.vim/ftplugin/go/fixmake.vim
set makeprg=go\ build\ %
au BufWritePost *.go make
import folium
# osaka
osaka_location = [34.702, 135.4951]
mapobj = folium.Map(location=osaka_location,
zoom_start=15)
mapobj.simple_marker(osaka_location, popup='Osaka Station')
mapobj.circle_marker(osaka_location, popup='An on foot 5-minute within the circle',
radius=500, fill_color='#33cccc')
mapobj.create_map(path='osm.html')