Skip to content

Instantly share code, notes, and snippets.

View brianm's full-sized avatar
Caffeinating

Brian McCallister brianm

Caffeinating
View GitHub Profile
#!/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:

public class HttpClient implements Call.Factory {
private final OkHttpClient ok;
HttpClient(final OkHttpClient ok) {
this.ok = ok;
}
/**
* Returns a CompletableCall, which supports CompletableFuture based enqueueing.
package org.skife.muckery.jackson;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.MappingIterator;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class ObjectStreamTest {