Skip to content

Instantly share code, notes, and snippets.

View spikegrobstein's full-sized avatar

spike grobstein spikegrobstein

View GitHub Profile
@spikegrobstein
spikegrobstein / zork.zsh-theme
Created March 19, 2022 04:35
zork clone from bash-it for oh-my-zsh
# terminal coloring
export CLICOLOR=1
export LSCOLORS=dxFxCxDxBxegedabagacad
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT="┌─[%B%{$fg[green]%}%n%{$reset_color%}%b][%{$fg[green]%}%m%{$reset_color%}]${git_branch}[%{$fg[cyan]%}%~%{$reset_color%}]
└─▪ "
ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg[green]%}%B±%b%{$reset_color%}]["
@spikegrobstein
spikegrobstein / readme.md
Created March 5, 2021 23:39
proof that bash can differentiate between undefined and an empty string

Example output

$ ./undefined_vs_empty.bash
x was not set.
$ ./undefined_vs_empty.bash -x ''
x was set to: ''
$ ./undefined_vs_empty.bash -x hello
x was set to: 'hello'
@spikegrobstein
spikegrobstein / config
Last active March 10, 2020 18:36 — forked from dtjm/config
Wrapper to use OS X FileMerge when calling `svn diff`
### ~/.subversion/config
### Add this line to the [helpers] section
diff-cmd = ~/bin/svn-diffwrap.sh
@spikegrobstein
spikegrobstein / macos-utilities.md
Created February 27, 2020 17:25
handy macOS utilities

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I 'networkname' -x

@spikegrobstein
spikegrobstein / docker-compose.yml
Last active November 20, 2024 23:35
docker-compose file for sabnzbd/sonarr/radarr
# start up with 'docker-compose up -d' to start in background
# update images with 'docker-compose pull'
# this assumes that you have a sibling directory to this file called 'config' that contains all of the config for these services
# you can reference 'sabnzbd' 'radarr' or 'sonarr' from inside the containers (in the apps) to reference the other containers. no need to deal with IPs or hostnames
# remember that docker is isolated from the rest of your filesystem. you need to add volumes to the entries
# in order to give the processes access to them. so if you have multiple target directories for TV or Movies,
# then make sure you add each one that you want radarr/sonarr/sabnzbd to see.
version: '3'
services:
fn sum(x: Vec<u32>) -> u32 {
x.iter().fold(0, |acc, i| acc + i)
}
fn main() {
let my_vec: Vec<u32> = vec![ 1, 2, 3 ];
println!("sum: {}", sum(my_vec));
}
#! /usr/bin/env bash
notify::send() {
local msg="$1"
local email
email="$( email_join "${email_list[@]}" )"
curl -v \
-XPOST \
Big Lebowski
Gramma's Boy
Princess Bride
Fifth Element
Superbad
Raiders of the Lost Ark
Back to the Future
Mad Max: Fury Road
Akira
The Matrix

Keybase proof

I hereby claim:

  • I am spikegrobstein on github.
  • I am spizzike (https://keybase.io/spizzike) on keybase.
  • I have a public key whose fingerprint is 66EC 70E4 2C9A 5DFF 5634 F55D 512C E515 E587 D7A0

To claim this, I am signing this object:

#! /bin/bash -
run_loop() {
local list=()
for item in $( seq 5 10 ); do
list+=("$item")
done
echo "List has ${#list[@]} items"
}