Skip to content

Instantly share code, notes, and snippets.

View wwarriner's full-sized avatar

William Warriner wwarriner

  • University of Alabama at Birmingham
  • Birmingham, AL
View GitHub Profile
@wwarriner
wwarriner / KeepUI_FFXIV.fx
Created July 14, 2024 03:51 — forked from natyusha/KeepUI_FFXIV.fx
Keep UI for FFXIV Mirror
// KeepUI for FFXIV
// Author: seri14
//
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
@wwarriner
wwarriner / perm_to_text.py
Created June 5, 2024 19:20 — forked from beugley/perm_to_text.py
Python script to convert a Linux octal permission number to a text string
def perm_to_text(perm):
perms = {
"0": "---",
"1": "--x",
"2": "-w-",
"3": "-wx",
"4": "r--",
"5": "r-x",
"6": "rw-",
"7": "rwx"
@wwarriner
wwarriner / test-permissions.sh
Last active February 19, 2024 23:05
Linux Permission Interactions Test
#! /bin/bash
set -e
set -o pipefail
while getopts ":s:t:c" arg; do
case "${arg}" in
s)
s="${OPTARG}"
;;
@wwarriner
wwarriner / latency.markdown
Created October 12, 2023 17:10 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@wwarriner
wwarriner / latency.txt
Created October 12, 2023 16:57 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@wwarriner
wwarriner / .bashrc
Created July 14, 2023 16:23
History improvements for .bashrc
# History extensions
shopt -s histappend
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=1000
export HISTFILESIZE=100000
export HISTTIMEFORMAT='%F %T ' # Include history time stamps
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
@wwarriner
wwarriner / env.yml
Last active June 14, 2023 22:50
How to: use Python with sqlalchemy into postgresql
name: sqlalchemy
channels:
- conda-forge
dependencies:
- pandas=2.0.2
- pip=22.3.1
- python=3.10.9
- sqlalchemy=1.4.39
- pip:
- psychopg2-binary==2.9.6

Hex Codes for Nature letter "Points of view: Color blindness"

Hex codes for https://www.nature.com/articles/nmeth.1618.

Name R G B HEX
Black 0 0 0 #000000
Orange 230 159 0 #E69F00
Sky Blue 86 180 233 #56B4E9
Bluish Green 0 158 115 #009E73
@wwarriner
wwarriner / bash_strict_mode.md
Created October 20, 2022 16:39 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@wwarriner
wwarriner / .zshrc
Last active September 29, 2022 04:13
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000