Skip to content

Instantly share code, notes, and snippets.

View amake's full-sized avatar
🌵

Aaron Madlon-Kay amake

🌵
View GitHub Profile
@amake
amake / git-svn-jenkins.org
Last active January 31, 2024 03:37
git-svn-Jenkins: Automating an svn-to-git mirror with hosted CI

Automating an svn-to-git mirror with hosted CI

There are plenty of tutorials for migrating from Subversion to git via git-svn, but they all seem to be focused on a one-time migration after which further development will happen in git. Otherwise the obvious use case for git-svn is where a lone developer uses git to push and pull to a Subversion repository from his local machine.

Like me, however, you may find yourself involved in a Subversion-hosted FOSS project with conservative leadership that strongly prefers Subversion to git. This project may also have an official git mirror of the svn repo, synced for years from a core developer’s personal machine.

You may then find yourself spearheading an effort to move this mirroring infrastructure to your project’s newly licensed hosted CI service.

This article discusses two main topics:

@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 / 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 / surrogates.swift
Last active July 11, 2016 16:00
Naked Unicode surrogates in Swift
// Making strings of "normal" Unicode is pretty easy:
// Unicode Scalar literal
"\u{2603}" // "☃"
// From int
String(UnicodeScalar(0x2603)) // "☃"
// Maybe you want to test how your app handles weird Unicode input, like naked surrogates.
// But Swift makes it pretty hard to create such strings.
@amake
amake / japanese-khk-words.py
Last active June 16, 2016 11:56
Generate a list of Japanese words that include at least one Kanji, Hiragana, and Katakana character
import urllib2
import re
dict_url = 'http://openlab.jp/skk/skk/dic/SKK-JISYO.L'
data = urllib2.urlopen(dict_url).read().decode('euc-jp')
words = set([l.split('/')[1].split(';')[0]
for l in data.split('\n')
if '/' in l and not l.startswith(';;')])
@amake
amake / unicode-portfolio.py
Created September 16, 2015 04:37
Generate a list of Unicode codepoints that are also stock tickers
import urllib2
# Data from Quandl: https://www.quandl.com/resources/useful-lists
data = ['https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/SP500.csv',
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/dowjonesIA.csv',
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/NASDAQComposite.csv',
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/nasdaq100.csv',
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/NYSEComposite.csv',
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/nyse100.csv',
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/FTSE100.csv']
@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 / okf_xml@stringsdict.fprm
Last active February 20, 2018 20:52
Okapi Rainbow filter for Apple Stringsdict files
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Okapi Rainbow configuration for Apple Stringsdict files
- Excludes untranslatable string values (NSStringFormatSpecTypeKey, NSStringFormatValueTypeKey)
- Attemps to create unique IDs for each string
See also: https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/StringsdictFileFormat/StringsdictFileFormat.html#//apple_ref/doc/uid/10000171i-CH16-SW1
-->
<its:rules
xmlns:its="http://www.w3.org/2005/11/its"
xmlns:itsx="http://www.w3.org/2008/12/its-extensions"

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 / 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,