Skip to content

Instantly share code, notes, and snippets.

View peabnuts123's full-sized avatar

Jeff peabnuts123

View GitHub Profile
@peabnuts123
peabnuts123 / benchmark_1.txt
Last active July 31, 2018 05:33
Raspberry Pi Benchmarks
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 4
Doing CPU performance benchmark
Threads started!
Done.
@peabnuts123
peabnuts123 / index.html
Created April 14, 2018 03:48
jQuery, SCSS, HTML example
<h1>FOOD CATEGORIES</h1>
<div class="Category">
<div class="Category-header" id="category-1-header">
<h1>Tapas</h1>
</div>
<div class="Category-body" id="category-1-body">
<ul class="is-red">
<li>Olives</li>
<li>Pickles</li>
@peabnuts123
peabnuts123 / components.my-component.js
Last active January 27, 2018 23:41
Tagless Element ES Class
import Ember from 'ember';
export default class MyComponent extends Ember.Component {
constructor() {
super();
// Empty string causes runtime error
// "Assertion Failed: You cannot use `elementId` on a tag-less component"
// Comment this line to fix
this.tagName = '';
@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.
@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 / 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 / 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
BYxFgqWBwcM
BYxGykLF_y9
iRyPdJSm-Z
zHuFCVIOsO
ilU45YSm1V
@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;
}
@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