// Leaflet JS - note the *className* attribute
// [...]
L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
className: 'map-tiles'
}).addTo(map);
// [...]
commands
- arduino-cli compile --fqbn adafruit:avr:protrinket5 [project name]
- arduino-cli upload -P usbtinyisp --fqbn adafruit:avr:protrinket5 [project name]
pre-reqs
- arduino-cli core install adafruit:avr
- (linux) arduino-cli core install arduino:avr
- (linux, maybe) install udev rules for trinket pro + restart udev
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
server.get('/downloadPdf/:fileData', function (req, res) { | |
// config | |
var fileData = Buffer.from(req.params.fileData, 'base64'); | |
var menuData = JSON.parse(fileData.toString()); | |
var userName = menuData.userName; | |
var menuName = slug(menuData.menuName); | |
var fileName = userName + "-" + menuName + PDF_EXT; | |
var filePath = PDF_PATH + fileName; | |
// process headers |
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
// Go here - https://www.cnn.com/interactive/2023/08/georgia-indictment-defendants-list-dg/ | |
// Open dev tools and paste what's below in Console tab | |
// Option 1: uncomment and run the first 'getEm' function for an unnumbered list of charges per defendant | |
// Option 2: uncomment and run the second 'getEm' function for an numbered list of charges per defendant | |
const getEm = ( numbered ) => { | |
const addNumberIfNumbered = index => numbered ? `${index + 1 + '. '}` : '' | |
return $$( '.charges-container' ).map( ( container, idx ) => { | |
const header = container.parentElement.querySelector( '.header' ) | |
const name = header.querySelector( '.name' ).textContent |
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
speakEnglish = () => { voices = speechSynthesis.getVoices(); voices.filter(voice => voice.lang === "en-US" ).forEach(voice => { | |
const utterance = new SpeechSynthesisUtterance("What's poppin, bitches?") | |
utterance.voice = voice; | |
// default volume !== 1 | |
utterance.volume = 1; | |
speechSynthesis.speak(utterance); | |
// next line causes function not to fire on first invocation 🤷🏾♂️ | |
utterance.addEventListener('start',()=>{console.log('voice name:', voice.name)}) | |
}) } | |
speakEnglish() |
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
// https://www.youtube.com/playlist?list=LL | |
let currentLike = 1, | |
// should allow time for menu open and click | |
removeDelay = 150, | |
// should be double remove delay | |
countDelay = removeDelay*2, | |
// get current total from stats section | |
totalLikes = parseInt(document.querySelector('#stats yt-formatted-string').textContent); | |
const countLikes = setInterval(()=>{ |
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
/*** The new CSS Reset - version 1.2.0 (last updated 23.7.2021) ***/ | |
/* Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property */ | |
*:where(:not(iframe, canvas, img, svg, video):not(svg *)) { | |
all: unset; | |
display: revert; | |
} | |
/* Preferred box-sizing value */ | |
*, |
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
// FIXME? | |
document.styleSheets[document.styleSheets.length - 1].addRule("::selection", "background: red; color: pink"); | |
document.addEventListener('selectionchange', e => { | |
console.clear(); | |
slice = document.getSelection().toString(); | |
if (slice !== "") { | |
parent = document.getSelection().getRangeAt(0).commonAncestorContainer.textContent; | |
preSlice = parent.slice(0, parent.indexOf(slice)); | |
postSlice = parent.slice(parent.indexOf(slice) + slice.length, parent.length - 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
(() => {return Function(`"use strict";return (${__f__})`)();}).call(null)() | |
// would normally do `eval(__f__)` where __f__ might be a stringified function | |
// name in an array |
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
// getting the output to look exactly like what's here | |
// https://node-girls.gitbook.io/beginners-javascript/challenges/challenge-4-fizzbuzz | |
const fizzBuzz = ( start, end ) => { | |
const format = ( idx, output ) => { | |
let out = output || ''; | |
outColors = { | |
true: 'color: #71a7ff', | |
false: 'color: orange' | |
} |
NewerOlder