Skip to content

Instantly share code, notes, and snippets.


John Elliott johnelliott

  • Seattle, WA
View GitHub Profile
tailscale status --self=false | tr -s ' ' '\t' | cut -f1-2

Multiple mutually-exclusive A-B tests available in parallel

Example code for selecting which A-B test to place a user in when wanting to run many tests. It's assumed a cookie or other state is stored with the user. Once a user is "in" a test they shouldn't be considered.

the number line approach

The number line approach uses a range of numbers between zero and one. Each test we want to run 'consumes' fractional space on the number line, with the remainder unoccupied. When an elegible user arrives at the experience —i.e. they do not have the piece of state or cookie indicating they're already

johnelliott /
Created Apr 20, 2020
Convert OpenTX model images with ImageMagick
# convert should be from ImageMagick 7+
# e.g. $ cat input.jpg | ./ > output.bmp
convert - \
-resize 64x32 \
-gravity center \
-extent 64x32 \
-colorspace gray \

Tips for using PCD:

... I also wanted [range downloads], but then I first used the seq and parallel programs. It's a very unix-y solution, but it turns out ids being integers is great. You may need to install and play with seq and parallel a bit, but this works for me:

episode downloads (echo must be removed for real downloading):

$ seq 4 10 |parallel echo pcd download mypodcast {}
pcd download mypodcast 4
pcd download mypodcast 5
pcd download mypodcast 6
johnelliott / .vimrc.coworker.vim
Last active Dec 19, 2019
View .vimrc.coworker.vim
unlet! skip_defaults_vim
if (filereadable($VIMRUNTIME .'/defaults.vim'))
source $VIMRUNTIME/defaults.vim
elseif (filereadable($VIMRUNTIME .'/vimrc_example.vim'))
source $VIMRUNTIME/vimrc_example.vim
set noswapfile nobackup nojoinspaces gdefault ignorecase wildignorecase showcmd
set tabstop=4 expandtab softtabstop=2 shiftwidth=2
set undodir=~/.vim/undo clipboard=unnamed
View BTFL_cli_20191018_202623.txt
# dump
# version
# Betaflight / STM32F7X2 (S7X2) 4.1.0 Aug 9 2019 / 11:41:22 (41a0b5938) MSP API: 1.42
# start the command batch
batch start
View html2jsonld
pup script[type=application/ld+json]|head -n2 |tail -n1|jq
View kubectlproxy.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
johnelliott / chrome.service
Last active Apr 30, 2019
Raspi TV Web Dashboard
View chrome.service
Description="Start chromium datadog on startup"
# public url https://my.prom
ExecStart=/usr/bin/chromium-browser --kiosk --disable-session-crashed-bubble --incognito "https://my.prom"