Skip to content

Instantly share code, notes, and snippets.

View lifthrasiir's full-sized avatar

Kang Seonghoon lifthrasiir

View GitHub Profile
@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-)
@lifthrasiir
lifthrasiir / powerlv.py
Created May 31, 2017 15:05
Brute forcing solver for the Illustration Power Level Calculator https://solarias.github.io/dnf/power_level.html
import sys
import string
import md5
import base64
def power_level(s):
return digest(md5.md5(base64.b64encode(s)))
def digest(m):
h = bytearray(m.digest())
@lifthrasiir
lifthrasiir / inquiry.md
Last active July 30, 2019 13:15
"구글, 'https' 채택 안한 누리집에 안전하지 않은 곳 '낙인'" 기사에 대한 의견

아래 메일은 2017-02-12 21:43(이하 한국 표준시)에 한겨레 기사에 대한 의견으로서 기사에 제시된 김재섭 기자의 메일로 보낸 내용이다. 메일에서 사실 관계 등의 오류가 있다면 모두 나의 실수이다.

2017-02-13 14:53에 덧붙임: 더 이상 gist를 비공개로 할 이유가 없어졌으므로 공개로 전환. 이 메일에 대한 답변은 받았으나 공개할 만큼 중요한 반론이 들어 있진 않으며 공개 여부도 묻지 않았으므로 공개하지 않는다. 아래 글 자체에도 다양한 비문과 오자가 있으나 본래 보낸 내용을 살리기 위해 전혀 수정을 하지 않기로 했음을 양해 바람.

2017-02-13 19:00에 덧붙임: 이 기사의 후속으로 구글코리아 측의 기자간담회가 올라갔다. 새 기사에 대해서는 특이한 게 없으므로 노코멘트. 또한 위의 기사 링크를 미디어다음에서 한겨레 웹사이트로 가도록 수정.

원문

안녕하십니까, 귀하께서 작성하신 (물론 저는 그 진위를 알 수 없습니다만, 적어도 그렇게 나와 있는) 기사에 대한 의견을 제기하고자 메일을 씁니다. 이 메일은 저의 개인 의견이며 저를 고용하고 있는 회사나 단체 등의 의견을 전혀 대변하지 않음을 혹시나 싶지만 미리 밝혀 둡니다.

@lifthrasiir
lifthrasiir / temporenc.c
Created January 28, 2017 16:33
Example implementation for the proposed Temporenc byte format
// Example implementation for the proposed Temporenc byte format
// Kang Seonghoon, 2017-01-29, public domain
#include <stdint.h>
#include <stddef.h>
#include <string.h>
struct temporenc {
int has_date: 1, has_year: 1, has_mon: 1, has_day: 1;
int has_time: 1, has_hour: 1, has_min: 1, has_sec: 1, has_nsec: 1;
| / Antidiagonals
|/_
Horizontals m l k j i h g
\ ,-------------. f Clues:
---} a / . . . . . . . \ e Ha .*H.*H.* Aa .*SE.*UE.* Da .*G.*V.*H.*
/ b / . . . . . . . . \ d Hb (DI|NS|TH|OM)* Ab .*LR.*RL.* Db [CR]*
c / . . . . . . . . . \ c Hc F.*[AO].*[AO].* Ac .*OXR.* Dc .*XEXM*
d / . . . . . . . . . . \ b Hd (O|RHH|MM)* Ad ([^EMC]|EM)* Dd .*DD.*CCM.*
e / . . . . . . . . . . . \ a He .* Ae (HHX|[^HX])* De .*XHCR.*X.*
f / . . . . . . . . . . . . \ Hf C*MC(CCC|MM)* Af .*PRR.*DDC.* Df .*(.)(.)(.)(.)\4\3\2\1.*
@lifthrasiir
lifthrasiir / .gitignore
Last active December 10, 2022 21:44
Precision wall clock benchmark in Rust
target
Cargo.lock
@lifthrasiir
lifthrasiir / .gitignore
Created August 27, 2016 05:15
Demonstrates the use of conditional attributes for proper documentation
target
Cargo.lock
target
Cargo.lock