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
  • 06:02 (UTC -05:00)
View GitHub Profile
@NerdyDeedsLLC
NerdyDeedsLLC / capture_input.sh
Created December 30, 2021 01:58
capture_input.sh - reads non-meta keystrokes from a bash shell (for key-operated menus and interfaces)
#!/bin/bash
function capture_input(){
export CAPPING=true
export SSTTY
if [[ "$(stty --save 2>/dev/null)" == "" ]]; then
SSTTY="$(stty -g)" #BASH
else
SSTTY="$(stty --save)" #ZSH
fi
@NerdyDeedsLLC
NerdyDeedsLLC / limerick.license.md
Last active September 28, 2021 01:15
License Type: Offensive Limerick (used on all my open source code since 2012)

LICENSE TYPE: OFFENSIVE LIMERICK

There once was a Dev from East Mass.,
who wished to ensure his code could be passed.
Feeling most license types,
  weren't worth all the hype
Wrote his own as an iconoclast.

His peers thought him a narcissist,
@NerdyDeedsLLC
NerdyDeedsLLC / combo-slider.js
Last active December 30, 2019 21:26
Combo-Sliders - textfields that act as a range slider when mousedown'd and held, but like a normal field when clicked/focused.
/*
CodePen Demo: https://codepen.io/ZenAtWork/pen/7a5c5e18834fb0584f310321a8c37456
USAGE
Include any standard text inputs you wish to convert to ComboSliders, and set each's class to "slider". ex:
<input type="text" id="testSlider" data-step="1" data-max="200" data-min="0" data-unit="%" data-value="10" class="ComboSlider" value="10" />
<input type="text" id="testSlider2" data-step="1" data-max="10" data-min="0" data-unit="px" data-value="5" class="slider" />
...then (recommended onLoad, but knock yourselves out), call the conversion routine provided within the API:
window.addEventListener('load', ComboSlider.convertAllComboSliders);
@NerdyDeedsLLC
NerdyDeedsLLC / SingletonDefaultExportInstance.js
Created November 23, 2019 20:22 — forked from dmnsgn/SingletonDefaultExportInstance.js
ES6 singleton pattern: module default exports an instance
class SingletonDefaultExportInstance {
constructor() {
this._type = 'SingletonDefaultExportInstance';
}
singletonMethod() {
return 'singletonMethod';
}
static staticMethod() {
@NerdyDeedsLLC
NerdyDeedsLLC / documentWrite.detailed.js
Last active October 16, 2019 12:22
Fix for document.write() violation. Renders the requested text at the position in the DOM where it is called, or as first element in body, if called from head or html
/**
* @license documentWrite.js 1.0.0 Copyright Nerdy Deeds LLC.
* Released under MIT license, nerdy.deeds@done.cheap
* This should be inserted into the very TOP of the HEAD element,
* to intercept any accidental doc.writes prior to its inclusion.
*/
document.write=function(val, d=document){ // Override native document.write behavior
if(!val || !d) return void(0); // If we've been given no ouput value or scope, bail out
var pars = callee = [...d.querySelectorAll('script')].pop(); // Gather all the <script> tags on page, and grab the last (the callee)
while(!/body|head|html/gi.test(pars.tagName)) pars = pars.parentNode; // Iterate the DOM until we hit body, head, or html
@NerdyDeedsLLC
NerdyDeedsLLC / nweb.sh
Created July 3, 2019 18:16
Freestanding source of nweb
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@NerdyDeedsLLC
NerdyDeedsLLC / BASH_Powerline_Auto-Installer.sh
Last active June 26, 2019 02:27
Automatic installer for powerline-status for BASH. Just run: $ curl -sL https://bit.ly/getpowerline | bash
#!/bin/bash
echo "
╔═ auto-execute: curl -sL https://bit.ly/getpowerline | bash ══╗
║ ║
║ ╭─────────────────────────────────────────────────────╮ ║
║ │ BASH PROMPT POWERLINE-STATUS AUTOMATIC INSTALLATION │ ║
║ ╰─────────────────────────────────────────── v.1.0.0 ─╯ ║
║ ║
║ AUTHOR: @JJ (Nerdy Deeds, LLC) CREATED: 06.25.2019 ║
@NerdyDeedsLLC
NerdyDeedsLLC / readme.md
Last active December 21, 2021 01:13
License Type: Offensive Limerick

LICENSE TYPE: OFFENSIVE LIMERICK

There once was a Dev from East Mass.,
who wished to ensure his code could be passed.
Feeling most license types,
  weren't worth all the hype
Wrote his own as an iconoclast.

His peers thought him a narcissist,
@NerdyDeedsLLC
NerdyDeedsLLC / readme.md
Last active December 23, 2018 05:11
CSS/JS Coordinate-Targeting Reticle (with visible pixel coordinates) - works by passing X/Y coordinates, specifying target element, or onClick anywhere within the window

Reticle.js

Displays a crosshair reticle (along with its corresponding coordinate pair) on screen. Useful for verifying object positioning, cursor position, locating X/Y coordinates of an object for callouts, etc.

Sample Red Reticle

Implementation/Usage Modes

Reticle currently has three modes:

1. Direct Placement Mode (Red Reticle)

A red reticle will be placed such that it's center lies precisely at the on-screen coordiantes specified. That is to say, it will entirely ignore your current scroll position. This is due to the reticle being absolutely-positioned. A fixed position reticle will respect the true coordinates, but will bollocks onClick mode. Thus, if you're so inclined to extend this out, keep that in mind.