Skip to content

Instantly share code, notes, and snippets.

View ikeikeikeike's full-sized avatar
🈵
Working

ikedat / Tatsuo Ikeda ikeikeikeike

🈵
Working
  • 3C
  • Tokyo, Japan
  • 15:24 (UTC +09:00)
View GitHub Profile
@ikeikeikeike
ikeikeikeike / great-namer.py
Created August 27, 2023 15:05
Great Namer.
stroke_data = {}
with open("./ucs-strokes.txt", "r", encoding="utf-8") as file:
lines = file.readlines()
for line in lines:
if not line.startswith("#"):
parts = line.strip().split("\t")
if len(parts) == 3:
_, char, count = parts
try:
stroke_data[char] = int(count)
@ikeikeikeike
ikeikeikeike / zero_downtime_reindexing.py
Created March 30, 2015 04:15
Elasticsearch Zero Downtime Reindexing using elasticsearch-dsl-py ref: https://www.elastic.co/blog/changing-mapping-with-zero-downtime
from datetime import datetime
from elasticsearch_dsl import (
DocType,
String,
Integer,
Float
)
def _suffix():
@ikeikeikeike
ikeikeikeike / gist:2028340
Created March 13, 2012 11:46
django logging fluentd
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': "%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]"
},
},
'handlers': {
'fluentinfo':{
@ikeikeikeike
ikeikeikeike / gist:3193547
Created July 28, 2012 14:09
apns check payload
import struct
def check_payload(string):
""" check payload
"""
if not isinstance(string, (str, unicode)):
return False
string = [string]
fmt = "!BH32sH%ds"