Skip to content

Instantly share code, notes, and snippets.

NightMachinary /
Last active Dec 2, 2021 — forked from hlissner/
Bulk search & replace with ag (the_silver_searcher)
# ag <>
# from=str1 to=sth agr path1 path2 ...
# backs up to .pbak
comment() {
doc() {
function agr {
doc 'usage: from=sth to=another agr [ag-args]'
NightMachinary / get_latest_release.zsh
Last active Apr 17, 2021 — forked from lukechilds/
Shell - Get latest release from GitHub
View get_latest_release.zsh
## See latest version at
## Usage:
# $ gh-release-get "creationix/nvm"
alias ec='print -r --'
function gh-release-get() {
local repo="$1"
local releases
releases="$(curl -s"$repo"/releases)"
View log.txt
❯ /usr/local/Cellar/gcc/10.2.0/bin/gcc-10 sh2bin.c -s -ldl -o foo -v 126
Using built-in specs.
Target: x86_64-apple-darwin19
Configured with: ../configure --build=x86_64-apple-darwin19 --prefix=/usr/local/Cellar/gcc/10.2.0 --libdir=/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-10 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 10.2.0' --with-bugurl= --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk SED=/usr/bin/sed
Thread model: posix
Supported LTO com
NightMachinary / book-notifier.zsh
Last active May 16, 2020
Notifies you when a book has become available on Libgen.
View book-notifier.zsh
#!/usr/bin/env zsh
#Install, GNU Timeout, and terminal-notifier (macOS only. Just delete the line for other OSes.). Use cron to check for a book regularly. (e.g., `0 9 * * * ~/book-notifier.zsh "little schemer"`)
gtimeout 6s libgen -s "$1" &> /dev/null
if [ $? -eq 124 ]; then
terminal-notifier -message "$1" -title "Book Has Become Available!"
echo "$1 is now available!"
View path
/Users/evar/my-music/Songs/Motion Picture's Soundtracks/More/Cécile Corbel - The Secret World Of Arrietty OST [FLAC]/20 - Cécile Corbel - Arrietty's Song (original Japanese version).flac
View scratchpad.zsh
(( $+functions[dvar] )) || function dvar() {
local pre=''
test -z "$2" || pre="CODE $2 | "
echo "$pre$(typeset -p "$1" 2>&1)"
echo "$pre$1 in env: $(printenv "$1")"
localesc() {
echo Innocence
tlocalesc() {

Keybase proof

I hereby claim:

  • I am nightmachinary on github.
  • I am resomnus ( on keybase.
  • I have a public key ASBpBS8xz0_k9cuJCvCCz15O-6BMcg69N0wKMK6ZhW8S8wo

To claim this, I am signing this object:

View gist:ff1307d42651b8f3e7d330d74b9b41f2
#!/usr/bin/env python3
Usage: <receiver> <message> [--file=<file>] (-h | --help) --version
-f <file> --file=<file> Sends a file, with message as its caption.
-h --help Show this screen.