Skip to content

Instantly share code, notes, and snippets.

View erawhctim's full-sized avatar

Mitch Ware erawhctim

  • Atlanta, Georgia
View GitHub Profile
@erawhctim
erawhctim / CompositeEventListener.kt
Last active May 6, 2024 22:05
OkHttp composite EventListener (based on OkHttp v4.9.2)
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
@erawhctim
erawhctim / g.fish
Created November 17, 2021 21:37
git wrapper function with line numbers for files
function g \
--description 'abbreviation for git-number w/auto completion' \
--wraps git
if string length -q -- $argv
switch $argv[1]
#ignore rebase, since it doesn't play nice with git-number
case "reb*"
git $argv
case "*"
git-number $argv
@erawhctim
erawhctim / g.fish
Created February 20, 2020 21:27
Fish function to replace git status with git-number
function g \
--description 'abbreviation for git-number w/auto completion' \
--wraps git
if string length -q -- $argv
switch $argv[1]
#ignore rebase, since it doesn't play nice with git-number
case "reb*"
git $argv
case "*"
git-number $argv
@erawhctim
erawhctim / bash-script-base.sh
Created January 16, 2017 16:03
Bash script starter file - colors, status messages, custom functions, etc
#!/bin/sh
# Originally pulled from: https://robots.thoughtbot.com/shell-script-suggestions-for-speedy-setups
# Exit if any subcommand fails
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'