Skip to content

Instantly share code, notes, and snippets.

package point
// Pointer turns any value into a pointer to that value
func Pointer[T any](v T) *T {
return &v
}

Keybase proof

I hereby claim:

  • I am ukiahsmith on github.
  • I am ukiahsmith (https://keybase.io/ukiahsmith) on keybase.
  • I have a public key ASASqYi4m9skHNeJ3wCFnViEI5m97l8A4Yk1SwDXvEX0nAo

To claim this, I am signing this object:

# Project title
A little info about your project and/ or overview that explains **what** the project is about.
A short description of the motivation behind the creation and maintenance of the project. This should explain **why** the project exists.
## Build status
#!/usr/bin/env sh
MINUTES=`echo $1 | bc 2>/dev/null`
if [[ $MINUTES -eq 0 ]]; then
MINUTES=10
fi
if [[ $MINUTES -gt 360 ]]; then
MINUTES=11
fi

I had a python script write some data to some images, but I didn't know which ones. This one liner was able to find which images were corrupted and open them in NeoVim for editing in binary mode.

find . -iname '*jpg' | tr '\n' '\0' | xargs -0 identify 2>&1 | grep -i error | sed "s/^.*\`\(.*\)\'.*/\1/" | tr '\n' '\0' | xargs -0 nvim -b
@ukiahsmith
ukiahsmith / run-vm-headless.scpt
Created March 27, 2016 03:44
Run an headless VM and connect to it via SSH in a new iTerm tab
# Create a server vm called "DevServer"
do shell script "/usr/local/bin/VBoxHeadless -s DevServer &> /dev/null &"
do shell script "sleep 5"
set conn to "DevServerConn"
set fn to "
function DevServerConn() {
# connect with ssh
# devserver is an alias hostname that is configured in ~/.ssh/config
ssh devserver

Keybase proof

I hereby claim:

  • I am Supermighty on github.
  • I am supermighty (https://keybase.io/supermighty) on keybase.
  • I have a public key whose fingerprint is 522D 1DA1 9A05 E2CD 3F09 EA2A E09D F4C4 D929 7739

To claim this, I am signing this object:

Quick batch rename in BASH to remove ?query=strings from files
for file in *.zip\?*; do mv "$file" "${file%%\?*}"; done