Skip to content

Instantly share code, notes, and snippets.

View bmcminn's full-sized avatar

Brandtley McMinn bmcminn

View GitHub Profile
@bmcminn
bmcminn / greasestarter.user.js
Last active December 21, 2022 22:01
JS: A simple boilerplate Grease/Tampermonkey script. This starter script aliases a custom jQuery instance on the page so you can start doing some fancy dom manipulation stuffs with absolutely no consequences.
// ==UserScript==
// @name SCRIPT_NAME_HERE
// @namespace NAMESPACE
// @version 0.1
// @description WIDGET_DESCRIPTION_HERE
// @match http*://*/*
// @include http*://*/*
// @copyright 2013+, YOURNAME
// ==/UserScript==
@bmcminn
bmcminn / __bookmarks.js
Last active December 20, 2022 03:47
Bookmarklets for fun and profit!
// SILENCE!!!
// dumb helpers functions
/**
* Generates a random integer between a min and max value
* @sauce https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#getting_a_random_integer_between_two_values
* @param number min
* @param number max
* @return number
*/
function randomInt(min, max) {
@bmcminn
bmcminn / fs.js
Last active January 7, 2021 03:25
This is a custom "build" of my favorite FS utility methods from `grunt.file` and the native Node `fs` object
const gruntFS = require('grunt').fs
const nodeFS = require('fs')
// init exported fs object
const fs = {}
// Map Grunt.file methods
fs.copy = gruntFs.copy
fs.delete = gruntFs.delete
// fs.exists = gruntFs.exists
@bmcminn
bmcminn / README.md
Last active May 27, 2020 21:05
Bookmarklets
@bmcminn
bmcminn / leap-day-check.php
Last active April 2, 2020 06:20
Testing date parsing in regards to leap year 2020
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Date Parsing</title>
</head>
<body>
<?php
@bmcminn
bmcminn / wtf-regex-non-alpha-numerica-range.js
Last active March 9, 2020 16:56
JS WTF?! Unsuspecting Regex range selector captures numbers and certain punctuation? Assuming it's due to a unicode/ascii coercion in the JS interpreter. Works in Node 5+ and in Browser console.
"testing, waffles 1234567+=-_^@,./;:[]\/".replace(/[+-_]/g, '')
// > "testing waffles "
@bmcminn
bmcminn / keyword-estimator.js
Last active March 3, 2020 21:32
WIP: This script makes some sweeping generalizations about your page content, but gives you a good rule of thumb approach to determining prevalence of certain keywords in your writing.
var _ = require('lodash')
, chalk = require('chalk')
;
var keywordAnalysis = function keywordAnalysis(content, options) {
// configure options
<script>
import Container from './Container.svelte'
</script>
<h1>App Name</h1>
<Container>
<div class:col-xs-3 class:col-md-2 class:col-lg-1>...</div>
<div class:col-xs-3 class:col-md-2 class:col-lg-1 class:hidden class:visible-md>...</div>
<div class:col-xs-3 class:col-md-2 class:col-lg-1>...</div>
@bmcminn
bmcminn / defaults.styl
Created January 17, 2020 17:27
Some default styles I like to include on most projects
// @sauce: https://getbootstrap.com/docs/4.4/getting-started/accessibility/#visually-hidden-content
.sr-only
position: absolute
width: 1px
height: 1px
padding: 0
margin: -1px
overflow: hidden
clip: rect(0,0,0,0)