Skip to content

Instantly share code, notes, and snippets.

View NerdyDeedsLLC's full-sized avatar
💣
Filling my office w/ deadly traps, so deadly trap enthusiasts might come visit.

Jason Jurusz (@JJ) NerdyDeedsLLC

💣
Filling my office w/ deadly traps, so deadly trap enthusiasts might come visit.
  • Nerdy Deeds, LLC
  • Kansas City, MO, USA
  • 21:55 (UTC -05:00)
View GitHub Profile
@NerdyDeedsLLC
NerdyDeedsLLC / README.md
Created September 24, 2023 23:03
BackinGIT v.2.0 - Gotta lot of branches? KNOW you coded something already, but cannot recall WHERE? Can't remember which branch you'd been working on 4 days ago when you had to switch gears? Start BackinGIT!

BackinGIT

BackinGIT is a simple command line tool that provides an interactive menu that lists all the previous branches you've checked out in reverse chronological order, along with the date and time of that access.

What? Why?

Trust me: at some point in your career, you'll find yourself with 4-5 active branches you're working in, be midway through something, and have a co-worker pop up and drag you off down a rabbit hole across multiple branches for multiple days. When you finally are able to resume what you'd been working on last Thursday, you'll think to yourself,

function RGBToHSL(HEXA, invert=false) {
let [r,g,b,a]=HEXA.replace(/^#?(?:(?:(..)(..)(..)(..)?)|(?:(.)(.)(.)(.)?))$/, '$1$5$5$2$6$6$3$7$7$4$8$8').match(/(..)/g).map(rgb=>parseInt('0x'+rgb)/255),
cmin = Math.min(r,g,b),
cmax = Math.max(r,g,b),
delta = cmax - cmin,
h = 0,
s = 0,
l = 0
i = invert? -100 : 0;
@NerdyDeedsLLC
NerdyDeedsLLC / contrastingColor.js
Created June 29, 2023 00:47
Lightweight function that will return the appropriate foreground color (white or black) when given a HEX/HEXA background color.
/**
contrastingColor(hex, factorAlpha)
@Description Accepts a HEX/HEXA color in any valid format (#HEX/#HEXA/#HHEEXX/#HHEEXXAA;
'#' is optional), and a boolean indicating if its opacity should be
considered and returns either '#000' or '#FFF' representing the preferred
foreground color for text atop it.
@param <STRING> hex any valid hex color code.
@param <BOOLEAN> factorAlpha whether or opacity should be considered (DEFAULT: false)
@returns <STRING> returns hex color code for white or black (#FFF/#000)
*/
@NerdyDeedsLLC
NerdyDeedsLLC / clr.sh
Last active June 12, 2023 19:23
Provides full hex color (#FF0000, #0F0, BADA55, D0A, etc) to Bash terminal
# clr
# Provides full hex color (#FF0000, #0F0, BADA55, D0A), etc) to Bash terminal
#
# clr <HEX COLOR> outputs the control character to set the desired foreground color:
# clr \#FFF (or clr '#FFF') # will set the foreground white.
# clr -b <HEX COLOR> uses the -b flag to output the control character to set the desired background color:
# clr -b #FF0000 # will set the background red
# clr with no parameters resets to default.
#
# The following aliases and shortcuts are also supported:
@NerdyDeedsLLC
NerdyDeedsLLC / flnm.sh
Last active June 1, 2023 17:03
BASH: Abridges & Shortens a FIle Path (e.g. flnm "/some/long/path/to/my/file/location/file.ext" 1 1 will produce "/some/.../location/file.ext")
# flnm - Breaks apart a file's path by "/" and returns only the number of folder specified for each side,
# followed by the file name.
#
# usage: flnm <filename> <leading elements> <trailing elements>
# if <leading elements> is provided and <trailing elements> is omitted, then returns ONLY the back n portions
# if <leading elements> is provided and <trailing elements> is omitted, then returns ONLY the file nane
# if <leading elements> + <trailing elements> exceeds the file's actual path length, then returns full file path
# if both <leading elements> and <trailing elements> are omitted, it assumes a value of 1 for each
#
# examples:
@NerdyDeedsLLC
NerdyDeedsLLC / diffall.sh
Created February 19, 2023 20:23
diffall.sh - Allows user to run a git diff <TARGET> against all local branches simultaneously.
#!/bin/bash
function diffall {
unset MATCH
unset DIFFALL_TERMINATE
DIFFALL_TERMINATE=0
MODIFIED="M"
WHITESPACE="-w --ignore-blank-lines"
INCLUDING=""
EXCLUDING=""
@NerdyDeedsLLC
NerdyDeedsLLC / Programming_Languages_Extensions.json
Created January 19, 2023 12:28 — forked from ppisarczyk/Programming_Languages_Extensions.json
Programming Languages and their File Extensions
[
{
"name":"ABAP",
"type":"programming",
"extensions":[
".abap"
]
},
{
"name":"AGS Script",
@NerdyDeedsLLC
NerdyDeedsLLC / README.md
Last active December 25, 2022 21:50
SSHELPER - Automagically creates and configures your SSH tokens for GitHub!

SSHelper.sh

This is a (at present, Mac-exclusive) command-line utility that will automatically perform all relevant steps required to get SSH up and running on your Mac with GitHub. It is a genuine, well-designed, superfine, one-time, one-line, benign, online, commandline goldmine to streamline your storyline and leave you on cloud-nine!

Oh, and it performs the following activities:

  1. Create an SSH key on your local machine
  2. Activate the SSH Agent
  3. Create/amend your SSH config file to contain the newly-created key
@NerdyDeedsLLC
NerdyDeedsLLC / audiovol.sh
Last active July 6, 2022 22:04
BASH & ZSH Script that (using AppleScript) allows for the adjustment of speaker AND MICROPHONE volumes from CLI.
function vol(){ audiovol 'output' $1; }
function mic(){ audiovol 'input' $1; }
function audiovol(){
AUDIO_IO=$1
NEW_VOLUME=$2
[[ "$AUDIO_IO" == "" ]] && AUDIO_IO='input'
[[ "$AUDIO_IO" == "input" ]] && DEVICE_TEXT='Microphone' || DEVICE_TEXT='Speakers'
if [[ "$NEW_VOLUME" == "" ]]; then [ "$(osascript -e "$AUDIO_IO volume of (get volume settings)")" -gt 0 ] && NEW_VOLUME=0 || NEW_VOLUME=100; fi
[ $NEW_VOLUME -gt 0 ] && MUTE_TEXT='Unmuted' || MUTE_TEXT='Muted'
@NerdyDeedsLLC
NerdyDeedsLLC / BackInGIT.sh
Last active November 21, 2022 20:58
BASH CLI utility that presents your branch history, paginated, in descending order, along with a menu interface for auto selecting the one you're after.
#!/bin/bash
LOADTEXT="
╔═══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ Loading BackInGIT.sh v.0.2... ✓ DONE ║
║ Can't remember which branch you were on 20 minutes ago? Having to jump from ║
║ one to the next like a coked-up kangaroo wearing moonshoes in a trampoline ║
║ factory? Just type bk for an interactive, date-stamped guide to your history ║
║ SYNTAX: bk <optionalPageSize> then follow the on-screen instructions ║
║ ║