Skip to content

Instantly share code, notes, and snippets.

View lifthrasiir's full-sized avatar

Kang Seonghoon lifthrasiir

View GitHub Profile
@lifthrasiir
lifthrasiir / jxl-preflate.py
Last active February 6, 2022 07:41
Super-experimental PNG recompressor with JPEG XL and reconstruction support
#!/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 June 16, 2021 02:50
Material Design Icons experiment for IconVG
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()
// ==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 September 18, 2020 03:48
2020-09-17 주호민 위펄래쉬2 "검열" 발언 전체 녹취
  • 정확도는 일절 보장하지 않음. 정확한지 아닌지는 링크 보고 판단할 것.
  • 본인은 주호민의 발언에 대해 비판적이지만 일부만 알려진 녹취록으로부터 유추한 대부분의 의견과는 다른 이유로 비판적임.

녹취

4:15:13

아이 아무튼, 이걸로 해서 위펄래쉬 시즌 2가 다 끝났습니다.
시즌 2를 하면서 느낀 거는, 위펄래쉬 시즌 2는,
@lifthrasiir
lifthrasiir / README.md
Last active January 30, 2023 15:55
Compact Temporal Notation (Provisional)

Motivation

I write a lot, a lot of personal journals in a plain text. They contain a lot of dates and times, many of them should be ideally tracked automatically (like, if I've written "15:00 tomorrow" some software ought to alarm at that time), so they should be written in a consistent manner. So far I've used ISO 8601 date and time format (e.g. 2020-09-05 or 11:30) and a bunch of natural extensions (e.g. tomorrow, last Sun).

And folks, it's verbose or often ambiguous to other plain text! For example I tend to schedule things in a multiple of hours so :00 is not necessary, but a single number 15 would be less recognizable as hours. Many systems will helpfully try to recognize at 15 or 3pm, but how would you know that at 15 is not a part of at 15 km/h or similar? Also my journals are in Korean anyway, and such workarounds tend to not work well crosslingually. How about the intervals like 15:00 thru 18:30? ISO 8601 interval 15:00/18:30 would be particularly problematic because a

@lifthrasiir
lifthrasiir / README.md
Last active September 19, 2023 12:33
〈정다면체는 사실 48종류 있음〉 번역 용어집

일반적인 용어가 없거나 부적절하여 새로 만들어낸 용어는 *로 표시함.
일부는 영어로도 정립된 용어가 없는데 이 경우 영어에도 *가 붙어 있음.

기본 용어

// c: canvas, x: canvas.getContext('2d'), S: Math.sin, C: Math.cos
// 아래 함수 내용은 초당 60회 불리고, 인자 t는 시작 후 지난 시간(초)이다.
// -----------
// 화면 초기화
// -----------
// 매 함수 호출마다 화면이 제거되진 않기 때문에 직접 지워 줘야 한다.
// 이전에 렌더링된 화면을 반투명 색깔로 덮어서 "꼬리"를 남긴다.
// 완전히 지울 경우 보통은 `c.width |= /*0으로 변환 가능한 수식*/`을 사용.
@lifthrasiir
lifthrasiir / stalk.py
Created April 19, 2020 16:26
Failed attempt to thoroughly analyze the Stalk Market with Z3
from z3 import *
from ctypes import c_float
import random
import math
import time
def roll(a, b, c, d):
n = a ^ ((a << 11) & 0xffffffff)
return n ^ (n >> 8) ^ d ^ (d >> 19)
# 2020-02-13 Kang Seonghoon
# Public Domain
import os
import xml.etree.ElementTree as ET
from collections import namedtuple
class Entry(namedtuple('Entry', 'category emergency lang')):
def __repr__(self):
return f'{self.category}{"!" if self.emergency else ""}{"#" if self.lang else ""}'
// ==UserScript==
// @name eagate captcha solver
// @namespace about:eagate-captcha-solver
// @version 0
// @match https://p.eagate.573.jp/gate/p/*
// @grant GM_xmlhttpRequest
// ==/UserScript==
let g_observer;