Skip to content

Instantly share code, notes, and snippets.

View brianm's full-sized avatar
Caffeinating

Brian McCallister brianm

Caffeinating
View GitHub Profile
@brianm
brianm / .gitignore
Last active April 26, 2024 07:34
Go net/rpc over ssh+netcat and unix domain sockets It would be nice if ssh.Session implemented io.ReaderWriter
local_client
server
client
ext
@brianm
brianm / bash_prompt.sh
Last active May 16, 2023 15:04
Encode $0 into color of hostname in PS1
# assumes 256 color support, do your normal case thing, etc
local green="\[\033[38;5;156m\]"
local blue="\[\033[38;5;153m\]"
local red="\[\033[38;5;009m\]"
local reset="\[\033[00m\]"
local git_stuff='$(__git_ps1 "\[\033[31m\]<\[\033[01m\]%s\[\033[22m\]>\[\033[00m\]")'
local status_color="\$(if [ \$? = 0 ]; then echo \"${green}\"; else echo \"${red}\"; fi )"
PS1="${status_color}\h${reset}:${blue}\w${git_stuff}${reset}$ "
#!/bin/zsh
# [BitBar](https://github.com/matryer/bitbar) script to display air quality
[[ -a ~/.zshrc ]] && source ~/.zshrc
# aqi can be installed via `brew install brianm/tools/aqi`
# whereami can be installed via `brew install brianm/tools/whereami`
tmp=$(mktemp)
whereami | xargs aqi -- | sort -rn > $tmp
echo "Air: $(head -1 $tmp | cut -f 2)"
wsf on  master ❯ cargo tree
wsf v1.1.9 (/Users/bmcc/src/github.com/brianm/wsf)
├── anyhow v1.0.31
├── chrono v0.4.11
│ ├── num-integer v0.1.42
│ │ └── num-traits v0.2.11
│ │ [build-dependencies]
│ │ └── autocfg v1.0.0
│ │ [build-dependencies]
│ │ └── autocfg v1.0.0
@brianm
brianm / wt
Last active September 13, 2018 17:37
#! /bin/bash
set -e
# Requires WT_GOOGLE_API_KEY be set to a valid Google API Key
# That means, it needs to have both timezone API and geocoding API enabled
# https://developers.google.com/maps/documentation/timezone/get-api-key
# https://console.developers.google.com/apis/credentials
if [ "$#" -lt 1 ] || [ -z "$WT_GOOGLE_API_KEY" ]; then
echo "Usage: $(basename $0) LOCATION" >&2
extern crate base64;
use std::fmt;
use std::io::{Read, Result};
pub struct Base64Decoder<'a> {
r: &'a mut Read,
config: base64::Config,
extra: [u8; 3],
@brianm
brianm / kubby.service
Last active September 27, 2017 23:36
[Unit]
Description=standalone kubelet
After=docker.service
Requires=docker.service
[Service]
User=root
ExecStartPre=-/bin/docker kill kubby
ExecStartPre=-/bin/docker rm kubby
ExecStartPre=-/bin/docker create \

Turning Off Github Issues

My friend Michael Jackson turned off github issues on one of his smaller projects. It got me thinking...

Maintainers getting burned out is a problem. Not just for the users of a project but the mental health of the maintainer. It's a big deal for both parties. Consumers want great tools, maintainers want to create them, but maintainers don't want to be L1 tech support, that's why they

package org.skife.memcake;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.skife.memcake.connection.Connection;
import org.skife.memcake.connection.Value;
import org.skife.memcake.connection.Version;

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: