Skip to content

Instantly share code, notes, and snippets.

View amake's full-sized avatar
🌵

Aaron Madlon-Kay amake

🌵
View GitHub Profile
@amake
amake / cjk-issue.txt
Last active September 1, 2016 02:05
Android CJK issue sample
与今令免入全具刃化外情才抵
次海直真神空者草角道雇骨
from https://en.wikipedia.org/wiki/Han_unification#Examples_of_language-dependent_glyphs
@amake
amake / io.jenkins.slave.plist
Last active June 7, 2016 07:44
Jenkins slave connection managed by launchd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>io.jenkins.slave</string>
<key>ProgramArguments</key>
<array>
<!-- If authentication is not required, you can launch via Java Web Start directly in the plist.
Otherwise you need a script like below.
@amake
amake / doservice-main.swift
Created June 2, 2016 09:11
A Swift CLI tool for calling arbitrary OS X Services
//
// main.swift
// doservice
//
// Created by Aaron Madlon-Kay on 6/2/16.
// Copyright © 2016 Aaron Madlon-Kay. All rights reserved.
//
import Foundation
import AppKit
@amake
amake / ios-android-glyphs-regex
Last active September 18, 2016 15:59
Unicode characters with glyphs available on both iOS 9.3 and Android 23
[\u0000-\u0377\u037a-\u037e\u0384-\u038a\u038c\u038e-\u03a1\u03a3-\u0527\u0531-\u0556\u0559-\u055f\u0561-\u0587\u0589-\u058a\u0591-\u05c7\u05d0-\u05ea\u05f0-\u05f4\u0600-\u0603\u0606-\u061c\u061e-\u061f\u0621-\u065e\u0660-\u070d\u070f-\u074a\u074d-\u077f\u07c0-\u07fa\u0840-\u085b\u085e\u0900-\u097f\u0981-\u0983\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7-\u09c8\u09cb-\u09ce\u09d7\u09dc-\u09dd\u09df-\u09e3\u09e6-\u09fb\u0a01-\u0a03\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a3c\u0a3e-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0af1\u0b01-\u0b03\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47-\u0b48\u0b4b-\u0b4d\u0b56-\u0b57\u0b5c-\u0b5d\u0b5f-\u0b63\u0b66-\u0b71\u0b83\u0b85-\u0b8a\
@amake
amake / glyphtest.swift
Last active December 14, 2017 05:28
Dump glyph names on iOS in order to test availability (Swift 3)
/*
* Make a dummy application and run this in e.g. UIApplicationDelegate.application(_:didFinishLaunchingWithOptions:)
*/
let filemanager = FileManager.default
let docsdir = filemanager.urls(for: .documentDirectory, in: .userDomainMask).first!
try! filemanager.createDirectory(at: docsdir, withIntermediateDirectories: true, attributes: nil)
let outfile = docsdir.appendingPathComponent("glyphtest.txt")
filemanager.createFile(atPath: outfile.path, contents: nil, attributes: nil)
@amake
amake / kanjiring.py
Last active May 31, 2016 06:59
Kanji Ring Generator
# -*- coding: utf-8 -*-
'''
Generate randomize rings of kanji with a shared component a la the classic
吾、唯、足るを知る:
 五
矢口隹
 止
@amake
amake / jesoftcorp2tmx.py
Last active May 24, 2016 07:15
Japanese–English Software Corpus to TMX
#!/usr/bin/env python
# Convert the parallel corpora available at
# http://www2.nict.go.jp/univ-com/multi_trans/member/mutiyama/manual/index.html
# to TMX format
import os
import re
import tarfile
import urllib
@amake
amake / kanji_and.py
Last active May 11, 2016 04:56
Kanji Bitwise-and Generator
# -*- coding: utf-8 -*-
'''Like Miyagawa's cute "生 & 死 = 愛" trick?
https://gist.github.com/miyagawa/2212589
This script generates every (jōyō) kanji & kanji = ? combination (no
args) or the result for supplied strings.
Note: A "wide" build of Python is required to handle surrogate chars
correctly.
@amake
amake / phraseextractor.py
Last active March 26, 2016 13:11
A simple Python phrase extractor
'''
A simple phrase extractor
Usage: cat file.txt | python phraseextractor.py [max_ngram] [min_count]
Options:
max_ngram: Maximum phrase length in words (default: 5)
min_count: Minimum number of phrase occurrences (default: 3)
'''
@amake
amake / Stringsdict.swift
Last active July 3, 2018 11:44
Advanced Apple .stringsdict
//: Playground - noun: a place where people can play
// Place included Localizable.stringsdict in ~/Documents/Shared Playground Data
import AppKit
import XCPlayground
let bundle = NSBundle(URL: XCPlaygroundSharedDataDirectoryURL)!
let format = NSLocalizedString("PhotosMoviesRemaining", tableName: nil, bundle: bundle, value: "", comment: "")