Skip to content

Instantly share code, notes, and snippets.

Avatar

Kang Seonghoon lifthrasiir

View GitHub Profile
@lifthrasiir
lifthrasiir / epyt-commented.js
Created Jul 13, 2022
epyt: a simple yet challenging typing game for JS1024 2022 https://js1024.fun/demos/2022/18/readme
View epyt-commented.js
// _
// ___ __ _ _ _ _| |
// / _ \ / _` | | | |__ | by Kang Seonghoon (@senokay, mearie.org)
// \__ | (_| | |_| |_| | 2022-07-13, for JS1024 2022
// |___/ \__, | .__/|__/ Public Domain (CC0 1.0)
// |_|\___|
//
// This is a simple typing game where you have lots of short English words to
// quickly type before a timer runs out. Perhaps most surprisingly, the game
// seems to have an access to lots of real English words (1,903 to be exact).
@lifthrasiir
lifthrasiir / dj40.c
Last active Sep 13, 2022
Pre-release version of J40 JPEG XL decoder, see https://github.com/lifthrasiir/j40 for recent releases
View dj40.c
#define J40_CONFIRM_THAT_THIS_IS_EXPERIMENTAL_AND_POTENTIALLY_UNSAFE
#define J40_IMPLEMENTATION
#include "j40.h"
#ifdef __GNUC__ // stb_image_write issues too many warnings
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wconversion"
#endif
#define STB_IMAGE_WRITE_IMPLEMENTATION
@lifthrasiir
lifthrasiir / radio.html
Created Apr 2, 2022
xkcd 2022-04-01: transcript and runner (up to 2:17:00)
View radio.html
<!doctype html>
<meta http-equiv=refresh content=2>
<canvas id=canvas width=2000 height=2000></canvas>
<script>
function draw(s) {
try {
const ctx = canvas.getContext('2d');
ctx.scale(1.5, 1.5);
ctx.translate(500, 500);
ctx.scale(1, -1);
View quine.cwa
// really inefficient MicroW8 quine
// 2022-03-01 Kang Seonghoon, public domain
import "env.memory" memory(4);
import "env.printString" fn printString(i32);
export fn upd() {
if 0!64 > 0 {
return;
@lifthrasiir
lifthrasiir / numeric-tzid.md
Last active Sep 25, 2021
Proposal for stable short identifier (or two) of time zones
View numeric-tzid.md

This proposal was originally written in 2018 as a concrete proposal for numeric time zone identifiers. I'm still not sure if this has a merit or not, but for the historical perspective, I reproduce the (incomplete) proposal in verbatim here. --Kang Seonghoon


[...]

The needs for the short and stable identifier are most importantly observed by the case of the Unicode CLDR project. CLDR required a stable identifier for the locales, which requires a stable identifier for the time zones. [...]

Short Identifiers

@lifthrasiir
lifthrasiir / brotli-preset.mjs
Last active Sep 10, 2021
Brotli preset dictionary recovery experiment
View brotli-preset.mjs
import * as fs from 'fs';
import * as crypto from 'crypto';
import * as zlib from 'zlib';
function makeBrotliPreset() {
const buf = [];
let bits = 0;
let nbits = 0;
const write = (v, n=1) => {
if ((v >>> 0) >= (1 << n)) throw 'write failed';
@lifthrasiir
lifthrasiir / jxl-preflate.py
Last active Feb 6, 2022
Super-experimental PNG recompressor with JPEG XL and reconstruction support
View jxl-preflate.py
#!/usr/bin/env python3
# jxl-preflate.py - Experimental reconstructable PNG recompressor to JXL
# Kang Seonghoon, 2021-07-18, Public Domain.
import sys
import os.path
import tempfile
import subprocess
import struct
import zlib
@lifthrasiir
lifthrasiir / analyze-material-design-icons-svg.py
Created Jun 16, 2021
Material Design Icons experiment for IconVG
View analyze-material-design-icons-svg.py
import os, os.path, sys, re, math, collections
mults = [1, 2, 4, 8, 10, 16, 100]
freqs = {}
for absmult in mults:
for relmult in mults:
freqs[absmult, relmult] = collections.Counter()
ops = collections.Counter()
lineops = collections.Counter()
View ridibooks-event-calendar.user.js
// ==UserScript==
// @name 리디북스 신간 캘린더 플러그인
// @namespace https://gist.github.com/lifthrasiir/200ae9a9b289520ceba835cd804c1cdd
// @version 1.4
// @author Kang Seonghoon (https://mearie.org/)
// @match https://ridibooks.com/event/*
// @run-at document-start
// @updateURL https://gist.github.com/lifthrasiir/200ae9a9b289520ceba835cd804c1cdd/raw/ridibooks-event-calendar.user.js
// @downloadURL https://gist.github.com/lifthrasiir/200ae9a9b289520ceba835cd804c1cdd/raw/ridibooks-event-calendar.user.js
// ==/UserScript==
@lifthrasiir
lifthrasiir / transcript.md
Created Sep 18, 2020
2020-09-17 주호민 위펄래쉬2 "검열" 발언 전체 녹취
View transcript.md
  • 정확도는 일절 보장하지 않음. 정확한지 아닌지는 링크 보고 판단할 것.
  • 본인은 주호민의 발언에 대해 비판적이지만 일부만 알려진 녹취록으로부터 유추한 대부분의 의견과는 다른 이유로 비판적임.

녹취

4:15:13

아이 아무튼, 이걸로 해서 위펄래쉬 시즌 2가 다 끝났습니다.
시즌 2를 하면서 느낀 거는, 위펄래쉬 시즌 2는,