Skip to content

Instantly share code, notes, and snippets.

View Bryce-MW's full-sized avatar

Bryce Wilson Bryce-MW

  • Chicago
  • 20:44 (UTC -04:00)
View GitHub Profile
@Bryce-MW
Bryce-MW / .bashrc
Created September 29, 2023 14:43
Terminal prompt
export NSH=$(python3 -c 'print(tuple(int(i, 10) if i.isdecimal() else 0 for i in __import__("sys").argv[1].split(".")) >= (4, 4))' "$BASH_VERSION")
export HST=$(echo $HOSTNAME | cut -d'.' -f1)
export HME="$HOME"
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
export IS__SSH=1
else
export IS__SSH=0
fi
if [ -z ${LC_RUSR=+x} ]; then
@Bryce-MW
Bryce-MW / bryce_annotate_builtins.py
Created February 27, 2022 07:09
Some stupid stuff for adding custom python builtins, you probably shouldn't do this
#! /usr/bin/env python3
# Symbols to be placed in __builtins__
new_builtins = {}
# Imports
import inspect
import builtins
import sys
import os
syntax jq ".*\.jq"
comment "#"
tabgives " "
# Pipes
color lightred,normal "\|"
# Variables
color magenta,normal "\$\w+\b"
# Some punctuation
@Bryce-MW
Bryce-MW / Example_Output.txt
Created February 27, 2022 07:04
macOS MOTD
Last login: Sat Feb 26 23:01:05 on ttys003
'c. bryce@bryce-mbp.local
,xNMM. ---------------------
.OMMMMo OS: macOS 12.1 21C52 arm64
OMMM0, Host: MacBookPro18,2
.;loddo:' loolloddol;. Kernel: 21.2.0
cKMMMMMMMMMMNWMMMMMMMMMM0: Uptime: 25 days, 10 hours, 50 mins
.KMMMMMMMMMMMMMMMMMMMMMMMWd. Packages: 90 (brew)
XMMMMMMMMMMMMMMMMMMMMMMMX. Shell: zsh 5.8
;MMMMMMMMMMMMMMMMMMMMMMMM: Resolution: 1728x1117
@Bryce-MW
Bryce-MW / brycerc.sh
Last active February 27, 2022 07:06
My bash/zsh commands
#! /bin/zsh
# Aliases to access the llvm- utils unprefixed (llvm-readelf as just readelf)
source ~/.bryce/llvmrc.sh
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export EDITOR='nano'
export PYTHONPATH="$HOME/.bryce/python:$PYTHONPATH"
export HOMEBREW_BAT="bat"
export IODINE_PASS="qwerty"
@Bryce-MW
Bryce-MW / smatrix.sty
Last active August 5, 2022 23:33
smatrix package for simple matrix notation
\ProvidesPackage{smatrix}[2020/11/11 Simple Matrix Syntax]
% To use this package, add it to the directory where your latex files are under the name smatrix.sty.
% Then, in your preamble, add the line \usepackage{smatrix}
% Matrix helpers
% \mx Supports matrices with up to 8 rows. Call like \mx[1,2,3][4,5,6][7,8,9], use \mx* for parentheses
% Arbitrary spacing is allowed so that you can make large matricies easy to read.
% For example:
% \mx[ 1, 0, 0]