Skip to content

Instantly share code, notes, and snippets.

View hhatto's full-sized avatar
⛰️
enjoy

Hideo Hattori hhatto

⛰️
enjoy
View GitHub Profile
@hhatto
hhatto / smartcropgo.go
Last active August 29, 2015 14:05
smartcrop.go cli
package main
import (
"fmt"
"image"
"image/jpeg"
_ "image/png"
"log"
"os"
@hhatto
hhatto / gist:423be867f462823ffd41
Created June 24, 2014 16:55
install libvips on Ubuntu14.04
- on Ubuntu 14.04
- apt-get install gtk-doc-tools swig gobject-introspection libgsf-1-dev ¥
libopenslide-dev libwebp-dev libcfitsio3-dev libmatio-dev libopenexr-dev ¥
libfftw3-dev libmagickcore-dev liborc-0.4-dev
- ./configure && make
@hhatto
hhatto / gist:ea6ce22403cf24e160d7
Created June 24, 2014 14:52
benchmark with scale image
## benchmarker: release 3.0.1 (for python)
## python platform: linux2 [GCC 4.8.2]
## python version: 2.7.6
## python executable: /usr/bin/python
## user sys total real
kaa.imlib2 0.8500 0.1300 0.9800 0.9883
PIL 8.6100 0.9400 9.5500 9.5611
PIL(fast) 1.0900 0.4500 1.5400 1.5460
pgmagick(blob-read) 0.2300 0.0200 0.2500 0.2500
@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 / vim_gui2cterm.py
Created September 1, 2013 17:31
convert from guifg/guibg to ctermfg/ctermbg for Vim Script
import sys
from grapefruit import Color
from fabulous.xterm256 import rgb_to_xterm
new_vim_color = []
def html2xterm256(color):
r, g, b = Color.HtmlToRgb(html_color)
r = int(r * 255)
@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')
@hhatto
hhatto / gist:5020052
Created February 23, 2013 14:58
occur error install pulsar via easy_install
$ easy_install -ZU pulsar
Searching for pulsar
Reading http://pypi.python.org/simple/pulsar/
Reading https://github.com/quantmind/pulsar
Best match: pulsar 0.4.6
Downloading http://pypi.python.org/packages/source/p/pulsar/pulsar-0.4.6.tar.gz#md5=9425e2110a6d2b0a6216121d52b12fc2
Processing pulsar-0.4.6.tar.gz
Running pulsar-0.4.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-4qNzrr/pulsar-0.4.6/egg-dist-tmp-oozueS
warning: no files found matching '*.py' under directory 'lib'
warning: no files found matching '*.h' under directory 'lib'