Skip to content

Instantly share code, notes, and snippets.

🦜 🦜 🦜 🦜

Dongsung Kim kiding

🦜 🦜 🦜 🦜
View GitHub Profile
kiding / thechoiceisyours.js
Last active Sep 9, 2021
thechoiceis466560 - All the Matrix 4 Teasers
View thechoiceisyours.js
This script checks ALL the possible Matrix 4 teaser URLs for their existence using HTTP HEAD.
Although the PR statement says the number of combinations is "more than 180,000,"
the actual app.js indicates there are actually 466,560 mp4 files generated and uploaded to S3.
It's possible some footages were recycled; maybe b = 1 and b = 3 are the same, etc.
const { createHash } = require('crypto');
const https = require('https');
kiding / NoScrollOnInputFocusiOSSafari.html
Last active Apr 17, 2022
Preventing iOS Safari scrolling when focusing on input elements
View NoScrollOnInputFocusiOSSafari.html
When an input element gets focused, iOS Safari tries to put it in the center by scrolling (and zooming.)
Zooming can be easily disabled using a meta tag, but the scrolling hasn't been quite easy.
The main quirk (I think) is that iOS Safari changes viewport when scrolling; i.e., toolbars shrink.
Since the viewport _should_ change, it thinks the input _will_ move, so it _should_ scroll, always.
Even times when it doesn't need to scroll—the input is fixed, all we need is the keyboard—
the window always scrolls _up and down_ resulting in some janky animation.
However, iOS Safari doesn't scroll when the input **has opacity of 0 or is completely clipped.**
kiding /
Last active Feb 24, 2022
Heterogeneous Homebrew: Apple Silicon & Intel Rosetta 2 side-by-side
# Install Homebrew at /opt/homebrew (for Apple Silicon)
arch -arm64e /bin/bash -c "$(curl -fsSL"
# Install Homebrew at /usr/local (for Intel Rosetta 2)
arch -x86_64 /bin/bash -c "$(curl -fsSL"
# Add these lines to ~/.zshrc
alias za="arch -arch arm64e /bin/zsh"
alias zi="arch -arch x86_64 /bin/zsh"
if [[ $(arch) == "arm64" ]]; then
kiding / HDRGainMap.swift
Last active Aug 4, 2022
Extracting HDR Gain Map from iOS 14.1+ (iPhone 12+) photos
View HDRGainMap.swift
import UIKit
import MobileCoreServices.UTCoreTypes
if #available(iOS 14.1, *) {
let input = Bundle.main.url(forResource: "IMG_0037", withExtension: "HEIC")!
let output = FileManager().temporaryDirectory.appendingPathComponent("IMG_0037.GAIN_MAP.BMP")
let source = CGImageSourceCreateWithURL(input as CFURL, nil)!
// urn:com:apple:photo:2020:aux:hdrgainmap
let dataInfo = CGImageSourceCopyAuxiliaryDataInfoAtIndex(source, 0, kCGImageAuxiliaryDataTypeHDRGainMap)! as Dictionary
kiding / KeepAll.playground.swift
Last active Apr 21, 2021
word-break: keep-all; but in Swift
View KeepAll.playground.swift
import UIKit
class KRLayoutManagerDelegate: NSObject, NSLayoutManagerDelegate {
func layoutManager(_ layoutManager: NSLayoutManager,
shouldBreakLineByWordBeforeCharacterAt charIndex: Int) -> Bool {
if charIndex <= 0 {
return true
let string = layoutManager.textStorage?.string as NSString?
kiding / 2018-2019.diff
Created May 30, 2019
(2018|2019)년도 병역지정업체 선정 및 (2019|2020)년도 인원배정 고시
View 2018-2019.diff
< ◉병무청고시제2018-1호
< 2018년도 병역지정업체 선정 및 2019년도 인원배정 고시
< 2018년도 병역지정업체 선정 및 2019년도 인원배정에 대하여 다음과 같이 고시합니다.
< 2018년 5월 23일
> ◉병무청고시 제2019-2호
> 2019년도 병역지정업체 선정 및 2020년도 인원배정 고시
> 2019년도 병역지정업체 선정 및 2020년도 인원배정에 대하여 다음과 같이 고시합니다.
> 2019년 5월 27일
kiding / KakaoTalk+.js
Last active Jan 28, 2019
KakaoTalk+: No More Search Pane (macOS)
View KakaoTalk+.js
Hide the annoying search pane.
$ sudo node KakaoTalk+.js
$ nohup /Applications/ </dev/null >/dev/null 2>&1
const { readFileSync, writeFileSync } = require('fs'),
{ execSync } = require('child_process'),
{ ok } = require('assert');
kiding / BCM.hcd.b64
Last active May 2, 2019
BCM4356A3 Firmware (for Nintendo Switch)
View BCM.hcd.b64

Keybase proof

I hereby claim:

To claim this, I am signing this object:

kiding / hangulJosa.js
Created Oct 9, 2014
한글 조사 자동 선택 스크립트
View hangulJosa.js
* 한글조사 - 은/는 이/가 을/를 과/와 이여/여
* @author Dongsung Don Kim <>
* @license MIT
// TODO: 으로/로
var hangulJosa = (function() {
var reT = /[0136-80136-8L-NRL-NRㄱ-ㅎ\uFFA1-\uFFBE\u3165-\u3186\u1100-\u115E\u11A8-\u11FF]/,
// 영일삼육칠팔 반각 전각, 대문자 알파벳 엘엠엔 반각 전각, 자음, 반각 자금, 옛자음, 조합 초성, 조합 종성
reF = /[24592459A-KO-QS-ZA-KO-QS-Zㅏ-ㅣ\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u3187-\u318E\u1161-\u11A7]/;