Skip to content

Instantly share code, notes, and snippets.

View soomtong's full-sized avatar
😇

YoungTaek soomtong

😇
View GitHub Profile
@soomtong
soomtong / geometry.el
Last active April 3, 2021 13:11 — forked from synic/geometry.el
(defun save-framegeometry ()
"Gets the current frame's geometry and saves to ~/.emacs.d/framegeometry."
(let (
(framegeometry-left (frame-parameter (selected-frame) 'left))
(framegeometry-top (frame-parameter (selected-frame) 'top))
(framegeometry-width (frame-parameter (selected-frame) 'width))
(framegeometry-height (frame-parameter (selected-frame) 'height))
(framegeometry-file (expand-file-name "~/.emacs.d/framegeometry"))
)
/*
Proof of concept: Writing dual-mode (sync and async) code via generators
Recommendation: start by reading the example (at the end).
API:
– The API object is called `def`.
– Dual-mode `await`: const unwrapped = yield wrapped;
– Dual-mode `yield`: yield def.$one(singleValue)
– Dual-mode `yield*`: yield def.$all(iterable)
@soomtong
soomtong / config.el
Last active January 16, 2021 07:34
doom emacs config file
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "YoungTaek Joo"
user-mail-address "soomtong@gmail.com")
@soomtong
soomtong / simple-zsh-env.md
Last active December 13, 2021 22:27
simple zsh setup guide
@soomtong
soomtong / hhkb.json
Last active April 1, 2022 15:27
happy hacking keyboard layout for macOS karabiner
{
"title": "HHKB for macOS",
"rules": [
{
"description": "shift + esc to tilde",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@soomtong
soomtong / encryption.js
Created April 2, 2020 06:36 — forked from vlucas/encryption.ts
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@soomtong
soomtong / gk888b.json
Created December 13, 2019 07:28
GK888B key layout for macOS
{
"title": "GK888B for macOS",
"rules": [
{
"description": "capslock to f16",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock"
@soomtong
soomtong / gk868b.json
Last active October 9, 2019 01:46
GK868B key layout for macOS
{
"title": "GK868B for macOS",
"rules": [
{
"description": "capslock to f16",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock"
@soomtong
soomtong / git-tag-delete-local-and-remote.sh
Created October 3, 2019 06:45 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@soomtong
soomtong / backtick-to-esc-karabiner.json
Last active April 1, 2022 15:27
To use Backtick key to Esc key for Macbook touchbar Vim users
{
"title": "backtick-to-esc.json",
"rules": [
{
"description": "Escape if backtick is pressed alone; post backtick if Command+Shift+backtick is pressed.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "grave_accent_and_tilde",