This is a list of all my bin helper files that I have at the moment. It's not much but they'll do.
Move these files to somewhere in your path. I put them in ~/bin
and have that
be the last place to look on my $PATH
# A basic null object that can be used in place of a `nil`. | |
class NullObject | |
def initialize(*); end | |
def method_missing(*); self; end | |
def respond_to?(*); true; end | |
def to_s; ''; end | |
def to_str; ''; end | |
def to_i; 0; end | |
def to_f; 0.0; end | |
def to_c; 0.to_c; end |
class BaseConnection | |
# @return [Faraday::Connection] | |
def connection | |
raise(NotImplementedError, 'not implemented') | |
end | |
def get(path, args={}, &block) | |
request(args.merge(method: :get, url: path), &block) | |
end |
#!/usr/bin/env bash | |
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/ | |
### | |
# Label definitions | |
### | |
declare -A LABELS | |
# Platform |
class Routing | |
include Rails.application.routes.url_helpers | |
attr_reader :uri, :host, :port | |
def initialize(args={}) | |
if args[:url] | |
parsed = URI.parse(args[:url]) | |
configure({ | |
host: parsed.host, | |
port: parsed.port, |
#!/bin/bash | |
echo "REMOVING MERGED BRANCHES..." | |
git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d | |
echo "PRUNING REMOTE BRANCHES..." | |
git remote | xargs -n 1 git remote prune | |
echo "EXPIRING REFLOG..." | |
git reflog expire --expire-unreachable=now --all |
#!/bin/bash | |
# For all your sub project ducttape needs | |
# Usage: ./tape client build | |
CARGO=$(which cargo) | |
PROJECT=$1 | |
COMMAND=$2 |
def run(cmd) | |
puts "===> #{cmd}" | |
system cmd | |
end | |
projects = %w(client editor server) | |
projects.each do |project| | |
namespace(project) do | |
desc "Cleans the #{project} project" |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# | |
set -eo pipefail | |
[[ "$TRACE" ]] && set -x | |
usage() { | |
echo "Usage: notes [help|edit|ls|show] <name>" | |
echo "Show any notes / cheat notes you have" | |
} |