Skip to content

Instantly share code, notes, and snippets.

@ospalh
ospalh / cjklib.diff
Created May 7, 2012 20:51
cjklib patch to match sqlalchemy changes
Subject: [PATCH] sqlalchemy.exceptions has been renamed sqlalchemy.exc ages
ago.
---
cjklib/build/__init__.py | 2 +-
cjklib/build/builder.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cjklib/build/__init__.py b/cjklib/build/__init__.py
index 952c084..6f4303b 100644
@ospalh
ospalh / dyndeckconf_py.diff
Created May 28, 2012 15:26
Quick fix for orphaned pupup list in Anki2
diff --git a/aqt/dyndeckconf.py b/aqt/dyndeckconf.py
index 5b021f0..c7867d4 100644
--- a/aqt/dyndeckconf.py
+++ b/aqt/dyndeckconf.py
@@ -4,7 +4,7 @@
from aqt.qt import *
import aqt
-from anki.utils import ids2str
+from anki.utils import ids2str, isMac, isWin
@ospalh
ospalh / kvgswap.py
Created February 28, 2013 15:00
Swap two stroke numbers in a [KanjiVG](https://github.com/KanjiVG/kanjivg) stroke order svg.
#! /usr/bin/env python2
# -*- coding: utf-8 ; mode: python -*-
# © Copyright 2013 ospalh@gmail.com
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import sys
__version__ = '0.0.1'
stroke_text_pattern = '>{0}</text>'
@ospalh
ospalh / kvgstrokedataswap.py
Created March 5, 2013 11:58
Similar to kvgswap.py Swap the actual vector data of two strokes around in a kanjivg kanki stroke order svg file.
#! /usr/bin/env python2
# -*- coding: utf-8 ; mode: python -*-
# © Copyright 2013 ospalh@gmail.com
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import re
import sys
__version__ = '0.0.1'
@ospalh
ospalh / 42-missing.xml
Last active August 29, 2015 14:01
A string missing in AnkiDroid source for 2.2alpha74
<!--
~ Copyright (c) 2014 Roland Sieker <ospalh@gmail.com>
~
~ This program is free software; you can redistribute it and/or modify it under
~ the terms of the GNU General Public License as published by the Free Software
~ Foundation; either version 3 of the License, or (at your option) any later
~ version.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT ANY
~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@ospalh
ospalh / changes done
Last active August 29, 2015 14:02
Sorting of KanjiVG files for JIS X 0213 2000→2004 changes
050c5 僅 Made stroke 11 longer
0514e 兎 Joined strokes 5 + 6
051a4 冤 Use 刀 element for strokes 3, 4
053a9 厩 Use left inner element similar to central element of 0537f etc.
053db 叛 Turned strokes 1, 2, closed strokes 8, 9
053df 叟 Split bottom of 臼, rearraged stroke order. Draw vertical first, added vertical-last variant.
05632 嘲 Use variant of 月
056c0 囀 Made stroke 16 longer, stroke 17 straight
05a29 娩 Joined strokes 8 + 10
05c60 屠 Added dot to 白-ish bit in modified 者 element
@ospalh
ospalh / copy-strokes-and-positions.py
Last active August 29, 2015 14:05
Extract stroke data and number positions out of an SVG file and put them into a KanjiVG file
#! /usr/bin/env python3
# -*- coding: utf-8 ; mode: python -*-
# © Copyright 2014 Roland Sieker <ospalh@gmail.com>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
"""Copy data from general SVG file to KanjiVG file
This is a helper script to copy data back from an SVG file edited with
a graphical editor such as inkscape to an KanjiVG SVG file.
0004b K:
close enough
02e8c ⺌:
close enough
02e8d ⺍:
close enough
03006 〆:
close enough
03044 い:
close enough
@ospalh
ospalh / codes and characters
Created November 20, 2014 13:51
The radicals moved to the sides. See https://github.com/KanjiVG/kanjivg/pull/92
02e8c ⺌
02e8d ⺍
02ea1 ⺡
02ea4 ⺤
02ea6 ⺦
02ea8 ⺨
034c1 㓁
04ea0 亠
04ebb 亻
05196 冖
@ospalh
ospalh / gist:70bea8c67b305951d15a
Created February 2, 2015 12:18
My .git_ignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
*.pyo