Skip to content

Instantly share code, notes, and snippets.

@shawalli
shawalli / tools.md
Last active January 6, 2023 16:12
Common OS tools and where to get them

MacOS

Mac App Store

  • Battery Monitor: Health, Info
  • Boop - run text snippets through common transformers, e.g. base 64 encode/decode, strip backlashes, etc
  • Patterns - RegEx tester, visually similar to regex101.com

Website

@shawalli
shawalli / bootstrap.sh
Last active April 1, 2020 20:07
Set up a Raspberry Pi W Zero with Go and TinyGo, in order to compile and flash to Arduino Uno
# Performed on a Raspberry Pi W Zero running Raspian/Buster
# $ uname -a
# Linux raspberrypi 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l GNU/Linux
export GO_VERSION=1.13.9
export TINYGO_VERSION=0.12.0
# Install Go
wget https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz
tar -xvzf go${GO_VERSION}.linux-armv6l.tar.gz -C ${HOME}
@shawalli
shawalli / log.py
Created November 5, 2018 17:59
[PYTHON] Global Logging Level
import logging
def initialize_logging():
logging.basicConfig(level=logging.INFO)
def set_level(level):
logging.root.setLevel(level)
for logger in logging.Logger.manager.loggerDict.values():
@shawalli
shawalli / .bash_alias
Created September 20, 2018 13:59
Git-Bash
# See https://superuser.com/a/564501
alias fix_window="kill -WINCH $$"
@shawalli
shawalli / watch
Last active September 14, 2018 14:52 — forked from flagranterror/gist:3852795
'Watch' command as a bash script.
#!/bin/bash
# This script *should* work on *nix and Windows, but was designed specifically for git-bash on Windows, to fill the watch gap.
clear
if [ "$#" -gt "2" ] && [ "-n" == "${1:0:2}" ]; then
time=$(echo $1 | sed -e 's/-n//')
shift
watchedcmd=$@
else
time="5" # Saneish default
@shawalli
shawalli / extensions.txt
Last active September 10, 2018 14:54
VSCode (.vscode) Portable Settings
# Run 'cat .vscode/extensions.txt | xargs -L1 code --install-extension' to install on new machine
CoenraadS.bracket-pair-colorizer
eamodio.gitlens
lextudio.restructuredtext
ms-python.python
npxms.hide-gitignored
oderwat.indent-rainbow
shardulm94.trailing-spaces
streetsidesoftware.code-spell-checker
yuichinukiyama.TabSpacer
@shawalli
shawalli / cheatsheet.md
Created August 7, 2018 18:14
PostGreSQL Query Cheatsheet

Dump Table Names

All

SELECT
    *
FROM
    information_schema.tables;

Non-PostGreSQL