This file contains hidden or 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 hidden or 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' | |
} |
This file contains hidden or 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": { |
This file contains hidden or 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/[email protected]/reset.min.css"> | |
<script type="module"> | |
import * as THREE from "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js" | |
import { OrbitControls } from "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/controls/OrbitControls.js" | |
var scene = new THREE.Scene() | |
var camera = new THREE.PerspectiveCamera(75) | |
camera.position.z = 4 |
This file contains hidden or 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 |
This file contains hidden or 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') // "ፍፁም፡በካይ" | |
This file contains hidden or 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
// OG | |
// https://jsfiddle.net/fitsum/40t8h2no/ | |
// params | |
s:String = string | |
f:String = filler character | |
e:String = effect name; eg. "rev", "zig" | |
w:Number = horizontal spacing | |
const ASCIIcade = (s, f = null, e = null, w = 3) => { |
This file contains hidden or 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
//TODO: add cursor bg and rotate script. can't tell what's happening without visual | |
let lastCoords = []; | |
const handleDir = e => { | |
let xDiff, yDiff, currCoords = [e.x, e.y]; | |
if ( lastCoords.length !== 0 ){ | |
xDiff = currCoords[0] - lastCoords[0]; | |
yDiff = currCoords[1] - lastCoords[1]; | |
} |
This file contains hidden or 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
fetch('https://api.scripture.api.bible/v1/bibles', {headers: {'api-key': 'ace65b88c21bc3d190f3f95754e2eede'}}) | |
.then((r) => r.json()) | |
.then((j) => { | |
const worldenglish = j.data.filter(item => item.name.indexOf('World English Bible') !== -1 ).map((item) => {return {"name":item.name, "description": item.description}}); | |
console.table(worldenglish); | |
}); | |
// Feeling fine about using `indexOf` | |
// https://stackoverflow.com/a/54538979 |
This file contains hidden or 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 a = [1,2,3,4]; | |
const checkType = (type, collection2check) => collection2check.every((each) => typeof each === type); | |
const curr = (collection) => { | |
return (actionOrType, actionFn) => { | |
return actionFn(actionOrType, collection) ? `all in ${collection} are ${actionOrType}s` : `few or none in ${collection} are ${actionOrType}s`; | |
}; | |
} | |
const arr = curr(a); | |
console.log(arr('number', checkType)) |