Skip to content

Instantly share code, notes, and snippets.

🎧
listening to hitsujibungaku

Hideo Hattori hhatto

🎧
listening to hitsujibungaku
Block or report user

Report or block hhatto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hhatto
hhatto / main.rs
Created Nov 17, 2019
rusoto sns example
View main.rs
use std::collections::HashMap;
use rusoto_core::credential::ProfileProvider;
use rusoto_core::request::HttpClient;
use rusoto_core::Region;
use rusoto_sns::{
Sns,
SnsClient,
CreatePlatformApplicationInput,
CreatePlatformEndpointInput,
View datetimebench.py
from datetime import datetime
from benchmarker import Benchmarker
with Benchmarker(1000*500, width=40) as bench:
@bench("datetime->str(strftime)")
def _(bm):
d = datetime(2019, 1, 2)
for i in bm:
@hhatto
hhatto / xmlbench.py
Last active May 8, 2019
benchmark of Python's XML parsing packages
View xmlbench.py
from xml.etree import ElementTree
from lxml.etree import XML
import xmltodict
import untangle
from benchmarker import Benchmarker
N = 1000 * 1
N = 1000 * 100
xml_string = """<?xml version="1.0"?>
View autopep8.inplace.diff
diff --git a/DreamGame.py b/DreamGame.py
index bbe3119..9723b73 100644
--- a/DreamGame.py
+++ b/DreamGame.py
@@ -34,18 +34,24 @@ class DreamGame(SimGame):
vision_aggro_rule,
damage_provokes_rule]
- def __init__(self, bf=None, rules=None, is_sim = False, is_server=True, seed = None):
+ def __init__(
@hhatto
hhatto / getaioname-on-pypi.sh
Created Sep 6, 2018
count of aio package name on PyPI
View getaioname-on-pypi.sh
#!/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 Jun 1, 2018
patch for Python 1.2 build on macOSX
View patch.diff
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;
View patch.diff
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)
@hhatto
hhatto / benchmarks.py
Last active Mar 14, 2018
benchmark of fpath module
View benchmarks.py
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"
View 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:

You can’t perform that action at this time.