Skip to content

Instantly share code, notes, and snippets.

View iolo's full-sized avatar

Dongsu Jang iolo

View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active June 27, 2024 18:48
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@charsyam
charsyam / timebased_otpcode_generator.go
Created January 13, 2021 13:54
Go Timebased OTP Code Generator
package main
import (
"crypto/rand"
"crypto/hmac"
"crypto/sha1"
"encoding/base32"
"time"
"fmt"
)
@soomtong
soomtong / dot.ideavimrc
Last active April 20, 2023 06:57
Jetbrains ideavim plugin vimrc
"noremap j gj
"noremap k gk
" inoremap jk <ESC>
" map space as leader key
let mapleader=" "
nnoremap <SPACE> <Nop>
" find in path
nnoremap gj viw:action FindInPath<CR>
@htr3n
htr3n / macos-ramdisk.md
Last active June 28, 2024 01:39
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@soomtong
soomtong / cloudSettings
Last active January 19, 2021 12:42
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-01-19T12:42:11.302Z","extensionVersion":"v3.4.3"}
@jakub-g
jakub-g / async-defer-module.md
Last active June 29, 2024 11:47
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

@elegantcoder
elegantcoder / korean_marker.rb
Last active February 16, 2019 11:41
한글 은/는, 이/가 (Powered by ActiveSupport::Multibyte::Chars)
# require 'active_support/all'
def korean_topic_marker(str)
k = str[-1] # last one char
return '는' if k.mb_chars.decompose.size < 3 # 종성이 없는 경우
return '은'
end
def korean_subject_marker(str)
k = str[-1] # last one char
@elegantcoder
elegantcoder / extract_korean_initials.rb
Last active July 22, 2018 14:44
한글 초성 분리기
# 삼성전자 => ㅅㅅㅈㅈ, 유안타제3호스팩 => ㅇㅇㅌㅈ3ㅎㅅㅍ
def extract_korean_initials(keyword)
initials = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ']
# hangul_range = '가'..'힣'
hangul_first = 44032 # '가'.ord
size = 588 # '까'.ord - '가'.ord
keyword.split('').collect do |k|
@seoh
seoh / slides.md
Last active May 25, 2020 22:22
Scala Night 2018
@rickyzhang82
rickyzhang82 / keycode.linux
Created September 15, 2017 22:11
Key code for Linux
# /usr/share/BasiliskII/keycodes
#
# Basilisk II (C) 1997-2005 Christian Bauer
#
# This file is used to translate the (server-specific) scancodes to
# Mac keycodes depending on the window server being used.
#
# The format of this file is as follows:
#
# sdl <driver string>