Skip to content

Instantly share code, notes, and snippets.

View mattrasband's full-sized avatar

Matt Rasband mattrasband

  • The Grid
  • 17:35 (UTC -06:00)
View GitHub Profile
local Plug = vim.fn['plug#']
vim.call('plug#begin')
Plug 'ctrlpvim/ctrlp.vim'
if vim.fn.executable('ag') then
Plug 'rking/ag.vim'
vim.g.ackprg = 'ag --nogroup --nocolor --column'
vim.opt.grepprg = 'ag --nogroup --nocolor'
@mattrasband
mattrasband / main.go
Created April 10, 2023 23:58
etcd watcher with previous values included in updates
package main
import (
"context"
"log"
"time"
"github.com/google/uuid"
etcd "go.etcd.io/etcd/client/v3"
)

Keybase proof

I hereby claim:

  • I am mattrasband on github.
  • I am mrasband (https://keybase.io/mrasband) on keybase.
  • I have a public key ASAvTot5k44rCi0V54QEwBpAUESXUd7cUzn3_6d4o484QQo

To claim this, I am signing this object:

@mattrasband
mattrasband / repos.sh
Last active October 28, 2020 21:19
repos.sh
#!/usr/bin/env bash
usage() {
echo "Usage: $0 -d <base directory> -u <github username> <repo list>" 1>&2
echo "repo list is a text file with remote:org/repo names (per-line). If remote is anything but origin, the remote is cloned and origin is set to GITHUB_USERNAME/repo.git" 1>&2
exit 1
}
github_username="$GITHUB_USERNAME"
dev_dir="$DEV_DIR"
from collections import deque
from typing import List
def fibonacci(seed: int, taps: List[int]):
"""Fibonacci Linear Feedback Shift Register"""
if not taps:
raise ValueError('Unable to create LFSR without taps.')
size = len(bin(seed)[2:])
@mattrasband
mattrasband / install.md
Last active October 29, 2019 00:32
Installing Arch

this is my incomplete list on installing arch recently with an encrypted disc

Boot the Live Env

archwiki

  • Verify it's EFI:
# ls /sys/firmware/efi/efivars
@mattrasband
mattrasband / dynamicdns.py
Created May 10, 2019 03:49
Quick script to dynamically configure my digital ocean dns for home IP rotation
#!/usr/bin/env python3
import json
import os
from pathlib import Path
from urllib.request import Request, urlopen
DOMAIN = os.environ["DOMAIN"] # hostname, like google.com
SUBDOMAIN = os.environ["SUB_DOMAIN"] # subdomain, like mail<.google.com>
DO_TOKEN = os.environ["DIGITALOCEAN_TOKEN"] # token for digital ocean
@mattrasband
mattrasband / install_heroku.sh
Last active April 26, 2019 20:57
Install Heroku CLI on Linux
#!/usr/bin/env bash
#############################################################################
# Utility script to install (and update) embedded heroku from their tarball.
#############################################################################
set -eox pipefail
if [ -L /usr/local/bin/heroku ]; then
echo "Heroku symbolic link found, removing"
@mattrasband
mattrasband / pre-commit
Last active November 25, 2023 12:51
pre-commit hook to run `black` for python auto-formatting
#!/bin/sh
# make sure black is available
which black > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Unable to run precommit hook, black is not available"
exit 1
fi
# find any staged py files
@mattrasband
mattrasband / .ctags
Created January 23, 2018 05:56
dotfiles
-f .git/tags
--recurse=yes
--exclude=.git
--exclude=log
--python-kinds=-iv
--tag-relative
--exclude=node_modules
--languages=-javascript