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 / getaioname-on-pypi.sh
Created September 6, 2018 12:50
count of aio package name on PyPI
#!/bin/zsh
curl "https://pypi.org/simple/" > pypi.package.list.html
echo -n "XXXaio :"
grep "/simple/" pypi.package.list.html | grep "aio/" | grep -v "/aio-" | grep -v "\-aio/" | wc -l
echo -n "aioXXX :"
grep "/simple/" pypi.package.list.html | grep "/aio" | grep -v "/aio-" | grep -v "\-aio/" | wc -l
@hhatto
hhatto / patch.diff
Created June 1, 2018 14:36
patch for Python 1.2 build on macOSX
diff --git a/Modules/rgbimgmodule.c b/Modules/rgbimgmodule.c
index 62e9e0b..331f9dc 100644
--- a/Modules/rgbimgmodule.c
+++ b/Modules/rgbimgmodule.c
@@ -499,7 +499,7 @@ int z;
while(1) {
pixel = *iptr++;
if ( !(count = (pixel & 0x7f)) )
- return;
+ return 0;
diff --git a/extensions/zeromq/CMakeLists.txt b/extensions/zeromq/CMakeLists.txt
index fe03f29..ebca041 100644
--- a/extensions/zeromq/CMakeLists.txt
+++ b/extensions/zeromq/CMakeLists.txt
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.2)
message("--- locating zeromq dependencies ---")
-find_package(ZeroMQ REQUIRED)
+#find_package(ZeroMQ REQUIRED)
0x00bc6b78D716e107a0C5D1b81FC64e50f5E045D3
@hhatto
hhatto / benchmarks.py
Last active March 14, 2018 09:03
benchmark of fpath module
import sys
import os
import fpath
from benchmarker import Benchmarker
N = 1000 * 100
FILENAME = "file.txt"
B_FILE_PATH = b"/home/user/path/to/file.txt"
FILE_PATH = "/home/user/path/to/file.txt"
DIR_PATH = "/home/user/path/to"
@hhatto
hhatto / keybase.md
Created February 16, 2018 14:27
keybase.md

Keybase proof

I hereby claim:

  • I am hhatto on github.
  • I am hhatto (https://keybase.io/hhatto) on keybase.
  • I have a public key ASCn-lUbCdnX2NMnYkwGz3J1KaRT_SjRQsNM5ezAzMdDTwo

To claim this, I am signing this object:

@hhatto
hhatto / bench.py
Created February 2, 2018 02:32
python csv module benchmark
from benchmarker import Benchmarker
import unicodecsv
import csv
import fcsv
NUM = 500 * 1000
NUM = 10 * 1000
source = [["abc", "def", "ghi"],
["jkl", "あいう", "opq"],
["vvv", "v1", "v2"]]
@hhatto
hhatto / bench_csv.py
Last active January 28, 2018 07:26
benchmark script for python csv module
# coding: utf-8
from benchmarker import Benchmarker
import unicodecsv
import csv
import fcsv
source = [["abc", "def", "ghi"],
["jkl", "あいう", "opq"],
["vvv", "v1", "v2"]]
source = (("abc", "def", "ghi"),
@hhatto
hhatto / uabench.py
Last active November 21, 2017 10:13
benchmark script for user-agent string parser
from benchmarker import Benchmarker
from ua_parser import user_agent_parser as uap_parser
from woothee import parse as woothee_parse
from fast_woothee import parse as fw_parse
ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36'
n = 1000 * 100
with Benchmarker(n) as bench:
@hhatto
hhatto / homebrew-upgrade-verbose.log
Last active October 10, 2017 15:27
fail upgrade jubatus 1.0.5 on macOS High Sierra
$ brew upgrade -v
==> Upgrading 2 outdated packages, with result:
jubatus/jubatus/jubatus 1.0.5, jubatus/jubatus/jubatus-core 1.0.5
==> Upgrading jubatus/jubatus/jubatus
rm /usr/local/bin/jubaanomaly
rm /usr/local/bin/jubabandit
rm /usr/local/bin/jubaburst
rm /usr/local/bin/jubaclassifier
rm /usr/local/bin/jubaclustering
rm /usr/local/bin/jubaconv