Skip to content

Instantly share code, notes, and snippets.

View ricealexander's full-sized avatar

Alex Rice ricealexander

View GitHub Profile
@ricealexander
ricealexander / glade-concept.js
Created July 12, 2023 19:35
Example of Glade Source Code
// Glade object stores useful properties and functions for workarounds
const Glade = {
currentPage: window.location.pathname,
}
// Identify when the page has changed using the custom event grove-navigate
setInterval(function () {
@ricealexander
ricealexander / self-injecting-script.html
Created January 4, 2022 21:30
Script that injects HTML content after itself. An alternative to document.write
<!-- Grove and other Single-Page Applications do not allow document.write() to be loaded on
pages that have been navigated to. In cases where absolutely necessary, we can use an
approach where content is self-injected. -->
<script id="embed">
var script = document.querySelector('#embed');
script.insertAdjacentHTML('afterend', "Hello World");
</script>
@ricealexander
ricealexander / getExpirationDates.js
Created January 4, 2022 21:09
List of Domain Name/Expiration Dates from Porkbun
let rows = document.querySelectorAll('.domainManagementRow')
let result = ''
for (let row of rows) {
let name = row.querySelector('.domainManagementDomainName').textContent
let expiration = row.querySelector('.toolTip.expiration-').textContent
result += `${name.trim()}\t\t\tExpires ${expiration.trim()}\n`
}
@ricealexander
ricealexander / self-injecting-module.html
Created October 20, 2021 19:57
Dump contents of an HtmlModule in Grove outside of its container
<!-- Dumping the contents of an HTML Module may be useful when prototyping certain changes -->
<!-- In this demo, we include HTML, CSS, and JavaScript in a modular format -->
<div data-dump="subhead-demos">
<h2 class="subhead subhead-A">Custom Subhead Styles A</h2>
<p>“Of course, we knew it wasn’t going to be something that was going to solve the situation at the border at that time, but we were touched by that,” said Otero Prada, a Colombian painter who has lived in St. Louis for 17 years.</p>
<p>The women, all visual artists, decided to create a mural project to spark conversations about the shared African experience in the Americas.</p>
<h2 class="subhead subhead-B">Custom Subhead Styles B</h2>
<p>“Of course, we knew it wasn’t going to be something that was going to solve the situation at the border at that time, but we were touched by that,” said Otero Prada, a Colombian painter who has lived in St. Louis for 17 years.</p>
@ricealexander
ricealexander / STLPR.master
Created June 4, 2021 19:49
Allegiance Pledge Pages (stlpr.org/donate)
<%@ Master Language="C#" %>
<!DOCTYPE html>
<html lang="en-US">
<head runat="server">
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="https://www.stlpublicradio.org/favicon.ico">
@ricealexander
ricealexander / OPI_Updates.md
Last active June 8, 2021 03:34
Documentation for the Online Member Portal Updates

Online Member Portal Updates

To update the Online Member Portal, go to "Online Donor Setup" in the "OPI" tab. Most of the content printed on the page can be found in the "Script Options" tab.

Proposed Changes (Script Options)

Support Number Formatting

On our main websites, we use the number formatting (###) ###-####. In Allegiance we use ###.###.#### and ###-###-####. Let's consolidate all support numbers to use the (###) ###-#### format.

@ricealexander
ricealexander / outlook-configuration.md
Last active January 15, 2024 00:44
Hurdles needed to Jump through for Microsoft Outlook to be halfway decent

Microsoft Outlook

Microsoft Outlook is a prime example of a Microsoft product that stopped innovating as soon as it began dominating the Enterprise marketshare. Examples of these failings include:

  • Their decades-out-of-date Spell Checker
  • Their convoluted Hyper-linking process which assumes all links are intended to be linked drive files by default
  • Their lack of an "All Unread" filter
  • Inconsistent feature parity between desktop client/mobile client/browser clients
  • Broken behavior when Rules/Filters combine Client processes and Exchange processes (Move an email into a folder (Exchange) and Mark it as read (Client))
  • Inability to Import or create templates for customized Signatures (without doing this work outside of Outlook)
@ricealexander
ricealexander / stlpr-footer.html
Last active April 14, 2021 23:20
STLPR Footer for Future Focus and Allegiance
@ricealexander
ricealexander / getFractions.js
Created March 30, 2021 22:05
Returns an array of all fractions of N
function getFractions (n) {
return Array.from({length}, (_, index) => (index + 1) / n)
}
// Example, all fractions of 16 (1/16, 2/16, 3/16, 4/16...)
getFractions(16) // [0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5, 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1]
@ricealexander
ricealexander / persistance-checker.js
Created March 30, 2021 22:02
Determine which elements were persisted on Grove SPA
(()=> {
let blockLevelElements = [
'address', 'article', 'aside', 'blockquote', 'canvas', 'dd', 'div',
'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'li', 'main',
'nav', 'noscript', 'ol', 'p', 'pre', 'section', 'table', 'tfoot',
'ul', 'video'
]
const elements = document.querySelectorAll(blockLevelElements.join(','))