Skip to content

Instantly share code, notes, and snippets.

View ricealexander's full-sized avatar

Alex Rice ricealexander

View GitHub Profile
@ricealexander
ricealexander / streamguys-platform-totals.js
Last active May 9, 2022 14:39
A fix for StreamGuys platforms reports, fixing the broken downloads total field
// StreamGuys Platforms Report Fix
// In the StreamGuys platform, all "Total" fields on tables are empty.
// This script can be run in the console and populates the "Total" field
// for all tables on the current page.
// Tables have an id following pattern /re\d+:table/
const tables = document.querySelectorAll('table[id^="re"][id$=":table"]')
for (const table of tables) {
const downloadsCells = table.querySelectorAll('tr:not(.standard-re-row-total) td.txt + td')
@ricealexander
ricealexander / .htmlhintrc
Created September 11, 2020 16:24
HTMLHint Configuration
{
// Enabled Rules
"doctype-first": true, // require doctype declaration at the very top of the HTML document
"doctype-html5": true, // require doctype to be HTML5’s <!DOCTYPE html>
"style-disabled": true, // prefer definining styles in external stylesheets
"title-require": true, // require <title> element in the <head>
"attr-lowercase": true, // disallow capital letters in attribute names
"attr-no-duplication": true, // disallow duplicate attributes on an element
"attr-no-unnecessary-whitespace": true, // disallow whitespace around attribute assignment operator =
@ricealexander
ricealexander / multilineStrings.js
Last active September 11, 2020 16:20
Comparison of Multiline-String Techniques in JavaScript
const modalTemplateLiteral = speaker => {
const { name, title, photo, altText, bio } = speaker
return `
<div class="speaker_modal_container">
<div class="speaker_modal">
<span class="sm_close" onclick="destroyModal()"><i class="fas fa-times"></i></span>
<h3 class="sm_speaker">
<span class="sm_name">${name}</span>
<span class="sm_title">${title}</span>
</h3>
@ricealexander
ricealexander / onHover.js
Created August 10, 2020 20:59
Detect hovering with JavaScript
function onHover (element, hoverOnCallback, hoverOffCallback = function () {}) {
let hoverInterval
function hoverOn () {
hoverInterval = setInterval(hoverOnCallback, 100)
}
function hoverOff () {
if (hoverInterval) clearInterval(hoverInterval)
hoverOffCallback()
}
@ricealexander
ricealexander / grove-custom-properties-fallback.scss
Last active July 27, 2020 16:35
Fallback values for custom properties for IE support in Grove
// Patch in variables that aren't defined
$buttonBgColor: initial;
$grayscaleColor1: initial;
$grayscaleColor2: initial;
$grayscaleColor3: initial;
$grayscaleColor4: initial;
$grayscaleColor5: initial;
$grayscaleColor6: initial;
$headerBackgroundColorMobile: initial;
@ricealexander
ricealexander / helpers.md
Created July 23, 2020 21:09
Helpers for Custom JavaScript in Grove CMS
@ricealexander
ricealexander / 2020 DNS Records.txt
Last active March 21, 2022 15:24
DNS records affiliated with STLPR's cPanel Account
Name TTL Class Type Record
--------------------------------------- ------- ----- ------- ----------------------------
kwmu.org. 14400 IN A 192.250.238.14
kwmu.org. 14400 IN TXT google-site-verification=eTVEmqxK4w9WDzPwz6hLF9ewHpRyD6DqxQQUiPP_-wU
kwmu.org. 14400 IN TXT v=spf1 +a +mx +ip4:192.250.238.14 ?all
kwmu.org. 14400 IN MX Priority: 0 Destination: mail.kwmu.org
cpanel.kwmu.org. 14400 IN A 192.250.238.14
cpcalendars.kwmu.org. 14400 IN A 192.250.238.14
cpcontacts.kwmu.org. 14400 IN A 192.250.238.14
@ricealexander
ricealexander / settings.json
Created April 15, 2020 21:29
ignoredResources should not be red in VSCode theme
{
"workbench.colorCustomizations": {
"gitDecoration.ignoredResourceForeground": "#727272"
}
}
@ricealexander
ricealexander / when-internet-explorer.scss
Created April 15, 2020 21:28
IE-11 Specific Media Query Mixin for SCSS
@mixin when-internet-explorer {
@media (-ms-high-contrast: active), (-ms-high-contrast: none) { @content; }
}
@ricealexander
ricealexander / long-selector.css
Created April 15, 2020 21:26
Longest CSS Selector I've written. Adds focus effects to custom radio buttons.
#theme #ctl00_AllegMain_MODETABLE td:focus-within input[type="radio"] + label::before,
#theme #ctl00_AllegMain_UPGRADETABLE td:focus-within input:not([value="ALLEGOTHER"]) + label,
#theme #ctl00_AllegMain_UPGRADETABLE td:focus-within input[value="ALLEGOTHER"] + label::before {
border-color: #222;
}