Skip to content

Instantly share code, notes, and snippets.

View reed-jones's full-sized avatar

Reed Jones reed-jones

View GitHub Profile
@reed-jones
reed-jones / pre-push
Created August 29, 2019 19:30
Git branch name check
#!/usr/bin/env bash
LC_ALL=C
local_branch="$(git rev-parse --abbrev-ref HEAD)"
valid_branch_regex="^(feature|bugfix|wip|junk|release|hotfix)\/[a-z0-9._-]+$"
message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your push will be rejected. You should rename your branch to a valid name and try again."
if [[ ! $local_branch =~ $valid_branch_regex ]]
@reed-jones
reed-jones / tmux.md
Last active April 23, 2019 14:57 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

// demo
// https://codesandbox.io/s/o3my2rxxy
<template lang="pug">
.wrapper(v-click-outside='_ => opened = false')
input.dropdown(
type='text'
ref='inputBox'
@click='opened = !opened'
@keydown.prevent=''
@reed-jones
reed-jones / dotfile-init.sh
Last active October 13, 2018 00:59
Restores previous dotfiles in a bare repo
#!/bin/bash
# passing arguments to curl
# curl http://foo.com/script.sh | bash -s arg1 arg2
args=("$@")
if [ $# -ne 1 ]; then
echo "Script must be passed a git repo containing dotfiles";
echo "e.g. ./dotfile-init.sh https://gitlab.com/reed-jones/dotfiles.git";
exit 1;
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and _
bind | split-window -h
bind _ split-window -v
unbind '"'
unbind %
# Set up the prompt
setopt histignorealldups sharehistory
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
source ~/antigen.zsh
antigen use oh-my-zsh
@reed-jones
reed-jones / kitty.sh
Created May 14, 2018 04:49
Kitty Terminal Build Script for a fresh Ubuntu 18.04
#!/bin/sh
# installs requirements and builds kitty from source
# on a fresh Ubuntu 18.04 install
#
# https://github.com/kovidgoyal/kitty
sudo apt install python3-dev git gcc build-essential pkg-config libharfbuzz-dev libpng-dev libfontconfig1-dev libgl1-mesa-dev libxkbcommon-x11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
cd /opt
sudo git clone https://github.com/kovidgoyal/kitty
@reed-jones
reed-jones / robbyrussell.zsh-theme
Created May 12, 2018 16:21
default oh-my-zsh theme, with hostname displayed
local ret_status="%(?:%{$fg_bold[green]%}➜:%{$fg_bold[red]%}➜)"
local hostname="%{$fg[cyan]%}%M"
PROMPT='${hostname} ${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@reed-jones
reed-jones / playlists.py
Created April 7, 2018 19:07
generates simple .m3u playlists
####
# Generates an .m3u playlist of all desired files
# Reed Jones 07/04/18
#
# python playlists.py
# >> generates .m3u containing all .mp4's in current directory by default
# >> saves as playlist.m3u
#
# python playlists.py --name my-great-playlist --extension .mp3 --path "C:\music\album"
# >> generates .m3u playlist containing all .mp4's and .mp3's in C:\music\album

Keybase proof

I hereby claim:

  • I am reed-jones on github.
  • I am reedj (https://keybase.io/reedj) on keybase.
  • I have a public key whose fingerprint is D66D 8F63 358E BE8B 3B3F 81EA 4FF9 C92B B069 8E3C

To claim this, I am signing this object: