Skip to content

Instantly share code, notes, and snippets.

@thewisenerd
thewisenerd / osx_haproxy_make.sh
Last active March 27, 2021 21:08
HAProxy with Lua on macOS
#!/usr/bin/env bash
# git clone http://git.haproxy.org/git/haproxy-2.3.git/
# have kanged same flags from https://github.com/Homebrew/homebrew-core/blob/1975b561eb4b525290139e3f66b7722e5f332b6a/Formula/haproxy.rb
LUA_LIB_NAME="lua5.4"
BASE_DIR="$HOMEBREW_PREFIX"
echo "using \$BASE_DIR=$BASE_DIR"
@thewisenerd
thewisenerd / maketh-config-defs.sh
Last active April 23, 2020 02:51
transmission-daemon systemd service
#!/usr/bin/env bash
# sudo groupadd -g 4200 p2p
# sudo useradd -r -u 4200 -g 4200 -s /usr/bin/nologin p2p
sudo -u p2p tee "/srv/transmission/config-defs/0" <<EOT
CONFIG_PORT=44290
CONFIG_DIR=/srv/transmission/config/0
EOT
.ContactPane-contact .ContactPane-mailSection .ContactPane-data .ContactPane-data-timestamp {
display: block;
}
.ThreadPaneView.isVisible .ActionPane {
flex: 1 0 0;
}
.ThreadPane-header {
max-width: initial;
@thewisenerd
thewisenerd / redis-cluster.py
Created September 15, 2020 15:26
redis-cluster.py
import redis
from redis.exceptions import ResponseError
class RedisCluster:
def __init__(self, *args, **kwargs):
self._a = args
self._kw = kwargs
self._c = redis.Redis(*args, **kwargs)
def shim(self, fn_getter, *args, **kwargs) -> any:
@thewisenerd
thewisenerd / bootstrap-parcel-react-typescript.sh
Created September 23, 2020 02:15
parcel bundler with react+typescript
#!/usr/bin/env bash
if [[ -e package.json || -e src ]]; then
echo "probably unsafe; files already exist"
exit 1
fi
yarn add react react-dom
yarn add typescript @types/react @types/react-dom --dev
yarn add parcel-bundler --dev
keepalive 10 20
connect-retry 5 5
writepid /usr/local/var/openvpn/client.pid
socket-flags TCP_NODELAY
data-ciphers AES-256-GCM:AES-128-GCM:BF-CBC
@thewisenerd
thewisenerd / 00-hello-superhuman.app.md
Last active December 7, 2020 19:44
Superhuman.app

sqlite3 database at '~/Library/Application Support/Superhuman/databases/https_mail.superhuman.com_0/'

  • fuzzy search on words (even with "")
  • fuzzy search on searching from: / to: even when email is "complete"
  • no way to zoom an image attachment
  • no way to rotate an image attachment
  • no quick actions on notifications
  • no easy way to collapse part of nested threads
  • configuring a search as split inbox adds a in:inbox by default
  • no way to use @Firstname Lastname instead of just @Firstname (@John Doe instead of @John)
@thewisenerd
thewisenerd / nohup-script.sh
Created December 30, 2020 00:57
nohup-script.sh
#!/usr/bin/env bash
SCRIPTNAME="script"
SCRIPT="script.sh"
echo "running $SCRIPTNAME nohup" "$@"
tmux new-window -d -t "nohup-${SCRIPTNAME}": "$SCRIPT" "$@" || tmux new -d -s "nohup-${SCRIPTNAME}" "$SCRIPT" "$@"
#!/usr/bin/env bash
set -euo pipefail
if [ ! -d node_modules/react-scripts-ts/ ]; then
echo "node_modules/react-scripts-ts not found"
exit 1
fi
BASE="node_modules/react-scripts-ts"