View speak-english.js
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() |
View remove-youtube-likes.js
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(()=>{ |
View reset.css
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 */ | |
*, |
View selection-snippet.js
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); |
View same-as-eval.js
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 |
View fizzBuzz-OCD.js
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' | |
} |
View .eslintrc.json
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
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"es2021": true, | |
"node": true | |
}, | |
"extends": [ | |
"standard" | |
], | |
"parserOptions": { |
View three.html
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
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reset-css@5.0.1/reset.min.css"> | |
<script type="module"> | |
import * as THREE from "https://cdn.jsdelivr.net/npm/three@0.124.0/build/three.module.js" | |
import { OrbitControls } from "https://cdn.jsdelivr.net/npm/three@0.124.0/examples/jsm/controls/OrbitControls.js" | |
var scene = new THREE.Scene() | |
var camera = new THREE.PerspectiveCamera(75) | |
camera.position.z = 4 |
View scratchmarklet.js
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
data:text/html, <html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>*scratch*</title><style> body{font-family:Hack,Menlo,Monaco,'Droid Sans Mono','Courier New',monospace;white-space:pre}body style{display:inline}style::before{content:'<style>'}style::after{content:'<\/style>'}*::before,*::after{color:rgba(136,18,128,0.5)}</style><script> const selectOuterMostNonBodyNode = (node) => node.parentNode.tagName === 'BODY' ? node : node.parentNode;function insertAfterSelection(selection,html){if(html === '') return;let nodeToInsert=document.createElement('div');nodeToInsert.innerHTML=html + '<br>';let range=selection.getRangeAt(0);let clone=range.cloneRange();let {endContainer} = range;range.setStartAfter(selectOuterMostNonBodyNode(endContainer)); range.insertNode(nodeToInsert);clone.setStart(clone.endContainer, clone.endOffset);selection.removeRange(range); selection.addRange(clone);} var globalEval=eval;function evaluate(){let selection=documen |
View amharic.txt
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
console.log('\u134D\u1341\u121D\u1361\u1260\u12AB\u12ED') // "ፍፁም፡በካይ" | |
NewerOlder