Skip to content

Instantly share code, notes, and snippets.

View lifthrasiir's full-sized avatar

Kang Seonghoon lifthrasiir

View GitHub Profile
@lifthrasiir
lifthrasiir / 00-README.md
Last active July 30, 2019 07:50
Unofficial English translation of Korean texts related to the metatron incident

I (Kang Seonghoon) have provided several translations to Github in light of the metatron incident, as Github staffs keep the investigation. I've reproduced my crude translations below (modulo formatting).

Please keep in mind that this is NOT the official translation. Any mistranslation or mistake is mine. Hopefully this should be at least better than Google Translate though.

@lifthrasiir
lifthrasiir / sumprod.c
Created June 7, 2019 14:51
reasonably efficient enumerator for https://oeis.org/A033178
#include <stdio.h>
#include <stdlib.h>
int recur(int n, int m, int k, int prevsum, int prevprod) {
if (m <= 0 || prevprod >= n) return 0;
int sum = prevsum + k, prod = prevprod * k, rem = (sum + m - 1) - prod;
int count = (rem >= 0 && prevprod > 1 && rem % (prevprod - 1) == 0);
for (; sum <= 2 * n && prod < n; ++k, ++sum, prod += prevprod) count += recur(n, m - 1, k, sum, prod);
return count;
}
@lifthrasiir
lifthrasiir / oeis.txt
Created May 9, 2019 16:41
(Partial) References to 176 OEIS Sequences from http://golf.horse/oeis/
# 001478 -n from -1
# 001489 -n from 0
# 000004 0
# 004526 floor(n/2)
# 002620 floor(n^2/4)
# 001057 interleaved 0 -1 -2... & 1 2 3...
# 000035 0 1 0 1...
# 010060 parity from 0
# 000014 series-reduced trees
# 001221 # distinct primes dividing n
@lifthrasiir
lifthrasiir / daerim.md
Last active May 23, 2019 06:11
<대림동에서 보낸 서른 번의 밤>의 웹 호환성 문제에 대해 (2019-02-03)

아래 내용은 지난 2월 3일 webmaster@sisain.co.kr에 보낸 메일을 거의 그대로 전재한 것이다. 두 달 넘게 응답은 없었다.

10일 넘게 응답을 받지 못한 뒤 김동인 담당 기자에게 트위터로 연락을 시도했으나 이 또한 응답받지 못했다.

해당 기사는 현재도 여전히 파이어폭스에서 정상적으로 표시되지 않는다. (2019-04-15)

안녕하세요. [<대림동에서 보낸 서른 번의 밤>][1] 기사를 보고 사소하지만 중요할 수 있는 문제를 알려 드리고자 글을 씁니다.

본 기사는 (요즈음에는 뉴욕타임즈 따위가 너무 많이 써서 오히려 식상할 수 있는) 스크롤할 때마다 애니메이션이 튀어 나오는 인터랙티브 포맷을 쓰고 있습니다만, 해당 포맷이 구글 크롬에서만 테스트된 것으로 보입니다. 모든 브라우저를 테스트하진

@lifthrasiir
lifthrasiir / TweetNaCl.cs
Created May 7, 2018 14:43
Semi-direct translation of TweetNaCl 20140427 (public domain)
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
namespace TweetNaCl
{
static class NaCl
{
public const int SECRET_BOX_KEY_BYTES = 32;
@lifthrasiir
lifthrasiir / gvim.sh
Last active May 9, 2022 20:59
Running Windows gvim.exe from WSL
gvim() {
local args rawargs path base usegvim=1 noopt=
declare -a args
rawargs=("$@")
while (($#)); do
case "$noopt$1" in
-[cSdirsTuUwW]|--cmd|--remote-expr|--remote-send|--servername|--version)
args[${#args[@]}]="$1"
rawargs[${#args[@]}]="$1"
shift
@lifthrasiir
lifthrasiir / alphabet.md
Last active February 16, 2024 19:03
The "Options" Alphabet
@lifthrasiir
lifthrasiir / normal.py
Created September 14, 2017 18:06
Homebrew implementation of Unicode Normalization algorithm, used for experiments (public domain)
# coding=utf-8
import sys
import os.path
from collections import defaultdict
try:
ucd = sys.argv[1]
except IndexError:
print >>sys.stderr, 'Usage: %s <ucd path>' % sys.argv[0]
@lifthrasiir
lifthrasiir / now.1m.sh
Last active June 1, 2017 14:57
BitBar plugin for xkcd.com/now (with embedded images, original scale)
This file has been truncated, but you can view the full file.
#!/bin/bash
read hour min tm <<<$(date '+%-H %-M %s')
CLOCKS=(🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 🕛 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦 🕧)
CLOCK_IDX=$[(hour+11)%12+min/30*12]
NOW_IDX=$[(tm-42750)/900%96]
echo ${CLOCKS[$CLOCK_IDX]}
echo ---
echo '| href="https://xkcd.com/now" image='$(grep "^$(printf %02d $NOW_IDX):" "$0" | cut -b4-)
exit
@lifthrasiir
lifthrasiir / now.1m.sh
Last active June 1, 2017 01:01
BitBar plugin for xkcd.com/now (with embedded images)
This file has been truncated, but you can view the full file.
#!/bin/bash
# Kang Seonghoon, 2017-06-01, public domain
# (except for embedded images from xkcd, which is CC-by-nc 2.5)
read hour min tm <<<$(date '+%-H %-M %s')
CLOCKS=(🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 🕛 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦 🕧)
CLOCK_IDX=$[(hour+11)%12+min/30*12]
NOW_IDX=$[(tm-42750)/900%96]
echo ${CLOCKS[$CLOCK_IDX]}
echo ---
echo '| href="https://xkcd.com/now" image='$(grep "^$(printf %02d $NOW_IDX):" "$0" | cut -b4-)