Skip to content

Instantly share code, notes, and snippets.

View amake's full-sized avatar
🌵

Aaron Madlon-Kay amake

🌵
View GitHub Profile
@amake
amake / xyj-count.py
Created August 24, 2014 12:09
Journey to the West (西游记) character count
'''
Count the number of characters in Journey to the West
'''
import urllib2
URL = 'http://www.sdmz.net/xy/%03d.htm'
CHAPTERS = 100
def do_count():
@amake
amake / init.el
Last active August 29, 2015 14:06
My emacs init.el
;; Increase default font size.
(set-face-attribute 'default nil :height 180)
;; Set decent default fonts for Japanese and Chinese,
;; but *only* if in a graphical context.
;; Set Japanese second so that Japanese glyphs override Chinese
;; when both charsets cover the same codepoints.
(if (fboundp 'set-fontset-font)
(progn
(set-fontset-font
@amake
amake / google-japanese-dict.txt
Created September 17, 2014 00:49
Google Japanese Input User Dictionary
m — 記号 em dash
ん – 記号 en dash
おー ō アルファベット
おー Ō アルファベット
うー ū アルファベット
うー Ū アルファベット
@amake
amake / launch-uihierarchy.json
Created April 21, 2015 07:35
Instruments UI hierarchy on launch
{
"@": {
"name": "SpringBoard",
"label": " ",
"value": null,
"dom": null,
"enabled": true,
"valid": true,
"visible": true,
"hint": null,

Keybase proof

I hereby claim:

  • I am amake on github.
  • I am amake (https://keybase.io/amake) on keybase.
  • I have a public key whose fingerprint is 4D1F C6E6 A5CC 3779 61F6 0A00 8518 D800 A1C6 CEF9

To claim this, I am signing this object:

@amake
amake / unicode-words.py
Last active September 25, 2015 12:40
Generate a list of Unicode codepoints that are English words
with open('/usr/share/dict/words') as infile:
words = infile.read().split()
hex_words = [w.upper() for w in words if len(w) == 4
and all(l in 'ABCDEFabcdef' for l in w)]
print ('\n'.join([u'U+%s %s' % (w, unichr(int(w, base=16)))
for w in sorted(hex_words)]).encode('utf-8'))
@amake
amake / weekyear.py
Last active October 30, 2015 06:15
ISO 8601 Week Year Snippets
#!/usr/bin/env jython
# Test standard Java classes
from java.text import *
from java.lang import *
fmty = SimpleDateFormat('yyyy-MM-dd')
date = fmty.parse('2015-12-27', ParsePosition(0))
print fmty.format(date, StringBuffer(), FieldPosition(0)) # 2015-12-27
@amake
amake / Android-strings-to-TMX.pln
Last active November 10, 2015 05:39
Okapi Rainbow pipeline for converting Android strings to TMX
<?xml version="1.0" encoding="UTF-8"?>
<!--
Pipeline for converting pairs of raw Android SDK values*/strings.xml
files into TMX (for translation reference, etc.).
Load this pipeline into Okapi Rainbow and set the input files, e.g.:
Input List 1: $ANDROID_HOME/.../values/strings.xml
Input List 2: $ANDROID_HOME/.../values-ja/strings.xml
Use the okf_xml@AndroidStringsImproved.fprm filter config included
@amake
amake / CLDR-Align.pln
Last active November 10, 2015 05:41
Convert CLDR data to TMX
<?xml version="1.0" encoding="UTF-8"?>
<!--
Pipeline for converting pairs of CLDR LDML data files into TMX
(for translation reference, etc.).
http://www.unicode.org/repos/cldr/trunk/common/main/
Load this pipeline into Okapi Rainbow and set the input files, e.g.:
Input List 1: en.xml
Input List 2: ja.xml
@amake
amake / TMXTimekeeper.py
Last active December 13, 2015 20:39
A script to analyze a TMX file and try to figure out how much time has been spent translating.
'''
TMXTimekeeper.py
Analyze a TMX file and try to figure out how much time
has been spent translating. Assume a minimum of 5 minutes
for translating "sessions".
Created on 2013/02/17
@author: Aaron Madlon-Kay