This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(()=> { | |
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(',')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Transcripts | |
// One possible way to associate transcripts with Grove posts may involve Shared Modules | |
// 1. Insert a Module at the bottom of the news post. | |
// 2. Select Shared Module and create a new Shared Module. | |
// 3. Select RichText Module and give it a subhead at the top titled "Transcript". | |
// 4. Copy/Paste the transcript from Google Docs into the RichText body. | |
// 5. Publish! | |
// | |
// This provides some benefits for us over other strategies: | |
// * Text is the most accessible format for our audience. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Audio Player</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/aplayer/1.10.1/APlayer.min.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/aplayer/1.10.1/APlayer.min.js"></script> | |
</head> | |
<body> | |
<!-- | |
This demo is built on top of APlayer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table id="talk-toast-tickets-table" border="1"> | |
<style> | |
#talk-toast-tickets-table { | |
background-color: white; | |
border: 1px solid #d5dce1; | |
margin: 1rem 0; | |
} | |
#talk-toast-tickets-table th { | |
background-color: #e1e6ea; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sponsors = [ | |
'BARNES JEWISH HOSPITAL', | |
'BARNES JEWISH WEST COUNTY HOSPITAL', | |
'BELLEVILLE NEWS DEMOCRAT', | |
'BESPOKE APPAREL', | |
'BETTER BUSINESS BUREAU', | |
'BIG BOW EVENTS', | |
'BIG O LIQUEUR', | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.Figure-content .Link { | |
color: var(--linkColor); | |
} | |
.Figure-content .Link:hover { | |
color: var(--linkHoverColor); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="box"> | |
<h3>Request a Transcript</h3> | |
<p> | |
Transcripts for St. Louis Public Radio produced programming are available upon request. | |
<br><br> | |
To request a transcript for <em>{PROGRAM NAME}</em>, | |
let us know the episode date and contact {CONTACT NAME} | |
at <a href="mailto:{CONTACT EMAIL}">{CONTACT EMAIL}</a>. | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function simplifies totalling up Reactions, Comments, and Shares in Facebook Insights | |
// To get the Reactions/Comments/Shares state, you must have the React Developer Tools Extension | |
// 1. Navigate to Page Insights > Reach | |
// 2. Set the date range at the top right of the view to the target range | |
// 3. Inspect the "Reactions, Comments, Shares and More" chart | |
// 4. In the React Components tool, navigate to c [from HubbleAreaLineChart] within HubbleChart | |
// 5. In the props, right click on "lines" and "Copy value to clipboard" | |
// The state of Reactions/Comments/Shares is now a nested array within your clipboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getItem (array, index) { | |
if (typeof index !== 'number' || Number.isNaN(index)) { | |
throw new TypeError(`Expected index to be a Number. Instead got "${index}"`) | |
} | |
if (Math.abs(index) === Infinity) { | |
throw new ReferenceError(`Cannot access item at index "${index}"`) | |
} | |
const {length} = array | |
let wrappedIndex = index |