Skip to content

Instantly share code, notes, and snippets.

comment_char %
escape_char /
LC_IDENTIFICATION
title "Shavian English locale"
source ""
address ""
contact ""
email "mwgamera@gmail.com"
tel ""
@mwgamera
mwgamera / test.py
Created February 4, 2022 17:44
ICU 𐑑𐑱𐑤𐑼𐑦𐑙 𐑮𐑵𐑤𐑟 𐑑 𐑓𐑦𐑒𐑕 𐑞 𐑚𐑮𐑴𐑒𐑩𐑯 ·𐑿𐑯𐑦𐑒𐑴𐑛 𐑒𐑩𐑤𐑱𐑖𐑩𐑯 𐑨𐑤𐑜𐑼𐑦𐑞𐑩𐑥 𐑓 𐑖𐑱𐑝𐑾𐑯
#!/usr/bin/env python
# 𐑖𐑱𐑝𐑾𐑯 𐑦𐑟 𐑷𐑮𐑛𐑩𐑮𐑛 𐑮𐑪𐑙 𐑦𐑯 UCA, 𐑤𐑧𐑑𐑕 𐑓𐑦𐑒𐑕 𐑦𐑑
# klg, 𐑡𐑨𐑯 2022
"""
𐑞 𐑕𐑑𐑨𐑯𐑛𐑼𐑛 𐑨𐑤𐑓𐑩𐑚𐑧𐑑𐑦𐑒 𐑹𐑛𐑼 𐑝 𐑖𐑱𐑝𐑾𐑯 𐑨𐑟 𐑜𐑦𐑝𐑩𐑯
𐑨𐑑 𐑞 𐑧𐑯𐑛 𐑝 ‹𐑖𐑷-𐑕𐑒𐑮𐑦𐑐𐑑› 𐑯𐑳𐑥𐑚𐑼 8 𐑦𐑟:
𐑐 𐑚 𐑑 𐑛 𐑒 𐑜 𐑓 𐑝 𐑔 𐑞 𐑕 𐑟 𐑖 𐑠 𐑗 𐑡 𐑘 𐑢 𐑙 𐑣
𐑤 𐑮 𐑥 𐑯 𐑦 𐑰 𐑧 𐑱 𐑨 𐑲 𐑩 𐑳 𐑪 𐑴 𐑫 𐑵 𐑬 𐑶 𐑭 𐑷
#!/usr/bin/env perl
# klg, Nov 2021
use strict;
# POSIX cksum(1) uses CRC with the same polynomial
# as Zlib but MSB-first while Zlib uses it reversed
# and starts from ~0 instead of appending the length.
# So one can be computed in terms of the other by
# reversing bits appropriately.
use Compress::Zlib 'crc32';
use constant BUF_SIZE => 4096;
@mwgamera
mwgamera / TC14-shavian.bdf
Last active November 25, 2021 10:36
8×14 𐑖𐑱𐑝𐑾𐑯 𐑚𐑦𐑑𐑥𐑨𐑐 𐑓𐑪𐑯𐑑
STARTFONT 2.1
COMMENT Shavian alphabet, necessarily bad; klg, Nov 2020
FONT -klg-TC14-Medium-R-Normal-shavian-14-140-72-72-C-80-ISO10646-1
SIZE 14 72 72
FONTBOUNDINGBOX 8 14 0 -2
STARTPROPERTIES 19
FOUNDRY "klg"
FAMILY_NAME "TC14"
WEIGHT_NAME "Medium"
SLANT "R"
#!/usr/bin/env ruby
# klg, Sep 2020
# https://xmpp.org/extensions/inbox/omemo-media-sharing.html
# frozen_string_literal: true
require 'openssl'
require 'net/http'
ARGV.each do |arg|
uri = URI(arg)
@mwgamera
mwgamera / dotjs2grease.rb
Created August 14, 2020 14:21
I tried using qutebrowser lately
#!/usr/bin/env ruby
# klg, Aug 2020
# frozen_string_literal: true
files = {}
Dir[File.join(Dir.home, '.{js,css}/?*.{js,css}')].each do |ent|
sta = File.stat(ent) # not lstat
files[[sta.dev, sta.ino]] ||= []
files[[sta.dev, sta.ino]] << ent
end
#!/usr/bin/env perl
# Fix some JPG data in SWF file so that swfrender doesn't trip on it.
# klg, Apr 2020
use strict;
use warnings;
use IO::Compress::Deflate;
use IO::Uncompress::Inflate;
my $src = \*STDIN;
my $dst = \*STDOUT;
#!/usr/bin/env nickle
# klg, Jul 2015
int[16] ChaCha20(int[16] x)
/* ChaCha20 hash function. */
{
int[16] s = x;
const int M = 0xffffffff;
void arx(int a, int b, int c, int r) {
s[c] ^= s[a] = (s[a] + s[b]) & M;
#!/usr/bin/env ruby
# klg, Dec 2019
require 'MeCab'
require 'erb'
def to_hira(str)
str.gsub(/[ァ-ヴヽヾ]/) do |x|
(x.ord - 96).chr x.encoding
end
end
#!/usr/bin/env perl
# Convert a vector or matrix of floating point numbers to a CDR format
# which can be relatively quickly loaded and decoded by GNU APL with 12⎕CR.
# klg, Aug 2019
use strict;
use warnings;
use constant CDR_FLT64 => 2;
my @shape = (0, 0);