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 fetcher = (...args) => fetch(...args).then((res) => res.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
function msToTime(duration) { | |
const portions = []; | |
const msInDay = 1000 * 60 * 60 * 24; | |
const days = Math.trunc(duration / msInDay); | |
if (days > 0) { | |
portions.push(days + 'd'); | |
duration = duration - (days * msInDay); | |
} | |
const msInHour = 1000 * 60 * 60; |
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 into wordle (https://www.powerlanguage.co.uk/wordle/) | |
//open js console (right click -> inspect -> console in top bar) | |
//paste the below code | |
//watch your wordle get solved! (100% GUARANTEED TO SOLVE, AT MOST 6 TRIES) | |
var guesses = eval(/var Ma=(\[.*"zymic"\])/.exec(await fetch(`main.${window.wordle.hash}.js`).then(r => r.text()))[1]); var answers = eval(/var Ma=(\[.*"shave"\])/.exec(await fetch(`main.${window.wordle.hash}.js`).then(r => r.text()))[1]);var all=[...guesses,...answers];const alphabet="abcdefghijklmnopqrstuvwxyz".split(""),matchesFilters=(t,e)=>t.filter((t=>{let r=!0;for(let o=0;o<e.length;o+=1){const{colour:s,position:n,letter:l}=e[o];if("black"===s&&t.includes(l)){r=!1;break}if("green"===s&&t[n]!==l){r=!1;break}if("yellow"===s&&(!t.includes(l)||t[n]===l)){r=!1;break}}return r})),colours=["green","yellow","black"],calculateLetterColor=(t,e,r,o)=>{const s=matchesFilters(t,[{colour:o,position:r,letter:e}]);return{p:1*s.length/t.length,list:s}},createObject=(t,e,r)=>{if(r>4)return e;{colours |
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 transpose = (m)=>m[0].map((_, i) => m.map(r => r[i])); |
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
// STEPS TO USE: | |
// 1. Go to https://www.youtube.com/feed/channels | |
// 2. Right click > Inspect Element > Console | |
// 3. Paste script | |
// 4. Press enter | |
var count = document.querySelectorAll("ytd-channel-renderer:not(.ytd-item-section-renderer)").length; | |
tick(); | |
function tick() { |
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 clamp = (num, min, max) => Math.min(Math.max(num, min), max); |
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
/* | |
num = val | |
newNum = ? | |
convert(2, 10, 4) //20 | |
convert(5, 10, 50) //100 | |
*/ | |
const convert = (num, val, newNum) => (newNum * val) / num |
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
//note: degrees only | |
const lerp = (start,end,amt) => start+(end-start)*amt | |
const clamp = (num, min, max) => Math.min(Math.max(num, min), max); | |
const repeat = (t, m) => clamp(t - Math.floor(t / m) * m, 0, m); | |
function lerpTheta(a, b, t) { | |
const dt = repeat(b - a, 360); | |
return lerp(a, a + (dt > 180 ? dt - 360 : dt), t); | |
} |
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 getRandomInt = (min, max) => min + Math.floor(Math.random() * (max - min + 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
function viewport() | |
{ | |
var e = window | |
, a = 'inner'; | |
if ( !( 'innerWidth' in window ) ) | |
{ | |
a = 'client'; | |
e = document.documentElement || document.body; | |
} | |
return { width : e[ a+'Width' ] , height : e[ a+'Height' ] } |
NewerOlder