Skip to content

Instantly share code, notes, and snippets.

jakebathman /
Last active May 8, 2019
"SSH" into one of your running docker containers
#! /bin/bash
## Setup note:
## Add execution permissions to this file using:
## chmod u+x
unset options i o
opt=( $(docker ps --format '{{.Names}}' | sort | awk '{print v++,$1}') )
# Show the user a list of containers to pick from
jakebathman / karabiner.json
Created Mar 20, 2019
Karabiner rule for double-press left shift -> caps lock
View karabiner.json
"description": "Double left shift to caps_lock",
"manipulators": [
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": ["any"]
jakebathman / giscus_62.test
Created Jan 2, 2019
Test for giscus bugfix (PR #62)
View giscus_62.test
This is a gist to test that Giscus is working as expected.
I will comment on this using another GitHub account in about a minute.
jakebathman / test_create_alarm.ts
Created Dec 30, 2018
Test file for createAlarm function PR for Shortcuts JS
View test_create_alarm.ts
// Only used to create the .shortcut file
const fs = require('fs');
const {
} = require('./');
const {
} = require('./actions');
jakebathman /
Created Nov 27, 2018
Search for a string in all diffs in a repo

Search through diffs

To make case-insensitive, add -i to all grep and git log commands

Search for "Telescope" (case sensitive) in all diffs in a repo

$ git log -STelescope

Result is something like this:

View nightbot commands
## Add multi and setmulti
!commands add !multi Multi-Stream Link:$(channel)
!commands add !setmulti -ul=moderator -a=!commands edit !multi Multi-Stream Link:$(channel)/$(query)
# usage: !setmulti other_stream/another_stream
jakebathman / .colors
Last active Oct 5, 2018
Terminal colors for your .aliases file (macOS)
View .colors
# First are the color variables
# Second is a function that will test the colors on your machine (tested on bash and zsh on macOS)
# Some terminals/OS's have weird inconsistencies with the escape codes,
# so google will be your friend if this doesn't work quite right
# You can copy/paste these into your .bashrc or similar file
# Don't forget to source the file again or restart your terminal session to apply!
# Normal Colors
export Black='\033[0;30m' # Black
jakebathman /
Created Oct 5, 2018
Git fetch upstream, to sync your fork with the original repo
# sync a fork using the upstream branch
# usage: gfu [branch-name (default: master)]
if [ -z "$1" ]; then
echo -n "Fetch and merge upstream for branch $BWhite$BRANCH$NC? [y/N]? "
jakebathman /
Created Aug 19, 2018
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
jakebathman /
Last active Jun 29, 2018
IRC server setup on CentOS 7
# This sets the variable $IPADDR to the IP address the new Linode receives.
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')
sudo yum update -y
sudo yum install nginx wget git -y
cd ~