Skip to content

Instantly share code, notes, and snippets.

HarJIT harjitmoe

Block or report user

Report or block harjitmoe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
harjitmoe / system_b_cyrillic.txt
Last active May 29, 2018
IBUS table for Cyrillic using adapted GOST 7.79 System B mappings.
View system_b_cyrillic.txt
NAME = System B
SERIAL_NUMBER = 20180528
UUID = db34eefb-cc62-46a8-85c2-d5b5a26444df
harjitmoe / xhtml2shim.js
Last active Jul 5, 2017
JavaScript shim to add support for suitably-namespaced XHTML2 elements in XHTML5 code (currently just <xhtml2:img>). Requires jQuery.
View xhtml2shim.js
// Namespaces assumed:
// xmlns=""
// xmlns:xhtml2=""
// xmlns:ev=""
// By Thomas Hori, copyright 2017. Zlib licence.
jQuery(function () { // Good practice to not assume $ at top level is jQuery (due to e.g. PrototypeJS).
var $ = jQuery;
# Copyright (c) Secret Labs AB 1997-2003.
# Copyright (c) Fredrik Lundh 1995-2003.
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
# Permission to use, copy, modify, and distribute this software and its
# associated documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appears in all
harjitmoe / daemonctl
Last active Jan 6, 2017
Send a service stop, start, restart or status instruction to Upstart (via initctl) or systemd (via systemctl) as appropriate. Relevant on e.g. Ubuntu Xenial, which uses systemd for its init, but still retains Upstart for certain Unity-related purposes.
View daemonctl
#!/usr/bin/env python
import subprocess, os, sys
DEVNULL = open(os.devnull,"r+")
ctlexes = ["initctl","systemctl"]
provides = ["start","stop","restart","status"]
harjitmoe /
Created Sep 26, 2016
Proof-of-concept Python preprocessing for Unicode variable names.
# -*- mode: python; coding: utf-8 -*-
"""Unicode Names preprocessor for Python 2."""
# Modified from tokenize module as support for parsing Unicode names
# had to be added.
old_doc = """Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
harjitmoe /
Last active Jan 19, 2017
Glue code for using PIL to load images into Pygame
from PIL import Image as pil_image
from pygame import image as pygame_image
def pil2pygame(im):
return pygame_image.frombuffer(im.convert("RGBA").tostring(),im.size,"RGBA")
def open_(name):
except IOError,e: #Compatibility with Pygame
from pygame import base
harjitmoe /
Last active Sep 20, 2016
Simple, very classic Python RegExp API for modern Python
r"""Older, simpler interface for simple RegEx operations.
Simple regular expression interface compatible with historic regexp
module (based on the from Python 1.1, which was included
without modification in subseqent versions before eventual
Ported by Thomas Hori to use the "re" API rather than the previous
"regex" module from Python 1.x as its backend.
View deseret-qwerty.txt
(obsolete, see )
harjitmoe / deseret.txt
Last active Apr 18, 2018
IBUS table for Deseret
View deseret.txt
# Library of Congress romanisation of Deseret (followed except for ï, which it does not define):
# >
# Macron accents (overlines) are represented here by a single x prefix, other accents (umlaut and
# circumflex) are represented by a doubled x prefix.
View rewild.js
* ReWild - Replacement for Wildfire.
* Copyright (c) 2016, 2018 HarJIT
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
You can’t perform that action at this time.