Skip to content

Instantly share code, notes, and snippets.

@dongminkim
dongminkim / keychron_q4.json
Last active December 19, 2022 08:48
Keychron Q4 Key Mappings (HHKB compatible style)
{
"name": "Keychron Q4",
"vendorProductId": 875823424,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_ESC",
"KC_1",
"KC_2",
"KC_3",
@dongminkim
dongminkim / esc-tilde.json
Last active September 7, 2022 08:27
Karabiner-Elements Complex Modifications for HHKB
{
"title": "Esc & Tilde - revised by @dongminkim",
"rules": [
{
"description": "Esc as Tilde",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@dongminkim
dongminkim / slack.colors
Last active September 28, 2018 12:45
Slack custom colors
#42362B,#544538,#8a7030,#ffffff,#544538,#FFFfff,#30D07A,#DB6668
@dongminkim
dongminkim / .Xdefaults
Last active September 28, 2018 12:43
X color settings
!!============================================================================
!! .Xdefault
!! ---------------------------------------------------------------------------
!! @AUTHOR 김동민 <[email protected]>
!! @DESC default X environment settings
!! @SINCE 1997
!!============================================================================
!-- Color Settings
@dongminkim
dongminkim / macos-sleep-wake-log.sh
Last active September 28, 2018 08:52
check macOS Sleep/Wake time log
#!/bin/sh
pmset -g log | grep ' \(Sleep\|Wake\|DarkWake\) '
# Generate PRIVATE KEY and PUBLIC CERTIFICATE:
# Samples use 'cocoa' as a passphrase.
openssl req -x509 -out public_cert.pem -outform pem -new -newkey rsa:2048 -keyout private_key.pem -days 5000
# Build PRIVATE PKCS #12:
openssl pkcs12 -export -out private.p12 -inkey private_key.pem -in public_cert.pem
@dongminkim
dongminkim / destructure.clj
Last active September 19, 2018 13:37
Clojure Samples
; Sequential destructuring
(def v [302 "asha" 98.7 [311 501]])
(first v)
(second v)
(last v)
(nth v 2)
(v 2)
(.get v 2)
(let [[a _ _ [b c]] v]
(format "a, b, c = %d, %d, %d" a b c))
@dongminkim
dongminkim / apply-macOS-shift-space-input-source-change-shortcuts.sh
Last active April 13, 2025 11:26
macOS(Mac OS X) 한영 전환을 Shift + Space 로 설정하기
#cp ~/Library/Preferences/com.apple.symbolichotkeys.plist /tmp/old.plist
defaults export com.apple.symbolichotkeys /tmp/old.plist
plutil -convert json /tmp/old.plist
# - Select the previous input source: .AppleSymbolicHotKeys."60"
# - Select next source in Input menu: .AppleSymbolicHotKeys."61"
# - 131072: Shift+Space
# - 655360: Shift+Option+Space
cat /tmp/old.plist | jq '.AppleSymbolicHotKeys."61".value.parameters=[32,49,131072] | .AppleSymbolicHotKeys."60".value.parameters=[32,49,655360]' > /tmp/new.plist
@dongminkim
dongminkim / color_converter.html
Created October 3, 2012 18:25
Color Converter (Hex and RGB)
<html>
<head>
<title>Color Converter</title>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<style>
div {margin:10px;}
</style>
</head>
<body>
@dongminkim
dongminkim / clear-undo.vim
Last active August 30, 2023 17:11
Clear Undo History in Vim 7.3+
" :help clear-undo (Vim 7.3+)
function! ClearUndo()
let choice = confirm("Clear undo information?", "&Yes\n&No", 2)
if choice == 1
let old_undolevels = &undolevels
set undolevels=-1
exe "normal a \<Bs>\<Esc>"
let &undolevels = old_undolevels
echo "done."
endif