Skip to content

Instantly share code, notes, and snippets.

View aahung's full-sized avatar
🔨

_sam aahung

🔨
View GitHub Profile
@aahung
aahung / .sh
Created February 13, 2017 06:57
Multithreading gzip Compress using pigz
# http://stackoverflow.com/a/12320421
# -9 for better compression
# 32 is number of cores to use
tar cf - paths-to-archive | pigz -9 -p 16 > archive.tar.gz
@aahung
aahung / README.md
Last active June 23, 2022 19:26
Quickly toggle "Connect on Demand" for IKEv2 VPN connection on Mac

Make sure you add the app invoking this script is in the Preferences -> Security & Privacy -> Pricavy -> Accessbility

For me, I use it with Alfred, so Alfred 3.app is in the list.

@aahung
aahung / .applescript
Created June 26, 2019 08:16
Open current folder in Kitty (apple script)
on alfred_script(q)
tell application "Finder"
set pathList to (quoted form of POSIX path of (folder of the front window as alias))
set textToType to "clear; cd " & pathList
end tell
tell application "System Events"
set isRunning to (exists (processes where name is "kitty"))
end tell
@aahung
aahung / eslint-ignore.sh
Created April 6, 2020 07:08
Add eslint ignore to all files (macOS)
find ./src -maxdepth 5 -type f -name *.tsx -exec sed -i '' '1i\
/* eslint-disable */
' {} \;

after Build 17093

  • can override settings by edit "/etc/wsl.conf"
  • normally this file is not exists at first
$ sudo vi /etc/wsl.conf

[interop]
appendWindowsPath = false
@aahung
aahung / README.md
Created January 31, 2021 05:49 — forked from ascendbruce/README.md
Use mac style keyboard shortcuts on Windows with AutoHotkey (ahk) script

Use (most) macOS style keyboard shortcuts on Windows

Make Windows PC's shortcut act like macOS (Mac OS X)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

Note that

  1. You should disable the Between input languages shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys because it conflicts with cmd + shift + ↑ / ↓ / ← / → (select text between cursor and top / bottom / beginning of line / end of line)
  2. you shouldn't change the modifier keys mapping with keyboard DIP. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.