Skip to content

Instantly share code, notes, and snippets.

View peabnuts123's full-sized avatar

Jeff peabnuts123

View GitHub Profile
@peabnuts123
peabnuts123 / register_standup_alias.sh
Last active July 11, 2017 21:54
Git Alias to show what you've done in the last day
git config --global alias.standup 'log --pretty="%ad %s" --since=yesterday --date="format:%m/%d %a %T%t" --author="Your Name"'
@peabnuts123
peabnuts123 / list-install-hooks
Last active August 8, 2017 02:14
Search `node_modules/` for any dependencies that have `preinstall`, `install` or `postinstall` hooks
#!/bin/bash
find node_modules/ -iname "package.json" -exec grep '"preinstall"\|"install"\|"postinstall"' {} \; -exec echo 'From: {}' \; -exec echo \;
@peabnuts123
peabnuts123 / .bashrc
Last active December 11, 2017 01:30
#TheBestBashPrompt #Objective
PS1="\[\e[30;43m\][\[\e[m\]\[\e[30;43m\]\T\[\e[m\]\[\e[30;43m\]]\[\e[m\]\[\e[30;42m\] \[\e[m\]\[\e[30;42m\]\u\[\e[m\]\[\e[30;42m\] \[\e[m\]\[\e[44m\]\w\[\e[m\]\[\e[41m\]\\$\[\e[m\] "
@peabnuts123
peabnuts123 / loop-command
Created August 30, 2017 10:31
Run non-terminating commands with the ability to force restart them
#!/bin/bash
# Validate argument exists
if [ -z "$1" ]
then
echo "No command specified."
echo "Usage: loop-command (command)"
exit 1
fi
# Get command from first argument
@peabnuts123
peabnuts123 / text-debug.css
Created September 7, 2017 22:44
CSS class for debug text that is both good for debugging and easy to notice (hard to leave in accidentally)
.Text--debug {
padding: 5px;
color: #000 !important;
border: 1px dashed #000 !important;
background-color: #FC0 !important;
white-space: pre-line !important;
}
BYxFgqWBwcM
BYxGykLF_y9
iRyPdJSm-Z
zHuFCVIOsO
ilU45YSm1V
@peabnuts123
peabnuts123 / them.js
Last active October 3, 2017 01:10
Naively replace gendered pronouns with non-gendered versions
/*
TITLE:
Them.js
VERSION:
0.1.0 (released 2017-10-03)
PURPOSE:
Replace gendered pronouns on web-pages with non-gendered versions in a non-intrusive way.
Not only do gendered pronouns subtly reinforce sexism and gender bias, I personally find that
@peabnuts123
peabnuts123 / Tally – Times where a simple solution was better than a sophisticated one
Last active October 17, 2017 08:05
Tally of times wherein a simple solution was far superior than a broad, nuanced, sophisticated solution to a problem
||
2017-10-07 Heuristic, ordinary A* was far more effective than my sophisticated, physical, pathfinding algorithm.
2017-10-17 Unity3D: Flipper component with an "Exception list" was simple and way better than separating out components with a "Semantic Parent" component
@peabnuts123
peabnuts123 / js--todo.css
Created October 31, 2017 01:39
Class for highlighting elements on a page as TODO without altering page structure
@keyframes seizure {
from {box-shadow: 0 0 0 4px #fd4b77,0 0 0 8px #fdf04b,0 0 0 12px #4bfdd0; }
20% {box-shadow: 0 0 0 4px #ffbd79,0 0 0 8px #fd4b77,0 0 0 12px #fdf04b; }
40% {box-shadow: 0 0 0 4px #514bfd,0 0 0 8px #ffbd79,0 0 0 12px #fd4b77; }
60% {box-shadow: 0 0 0 4px #f44bfd,0 0 0 8px #514bfd,0 0 0 12px #ffbd79; }
80% {box-shadow: 0 0 0 4px #4bfdd0,0 0 0 8px #f44bfd,0 0 0 12px #514bfd; }
to {box-shadow: 0 0 0 4px #fdf04b,0 0 0 8px #4bfdd0,0 0 0 12px #f44bfd; }
}
@keyframes throb {
@peabnuts123
peabnuts123 / tv-rename
Last active January 13, 2018 21:36
Rename files in a folder to the format of S01E01, S01E02, etc. so that parsers like Sonarr can correctly identify them.
#!/usr/bin/env node
/* TV Renamer
Purpose: Rename files in a folder to the format of S01E01, S01E02, etc.
So that parsers like Sonarr can correctly identify them. The Episode number
is based on a natural sort of the files in the current directory.
Usage: tv-renamer
No parameters. The user is prompted for Season # and asked to confirm before
any files are renamed.