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
async function hasStreetViewImage(lat, long, radius) { | |
const url = `https://maps.googleapis.com/maps/api/js/GeoPhotoService.SingleImageSearch?pb=!1m5!1sapiv3!5sUS!11m2!1m1!1b0!2m4!1m2!3d${lat}!4d${long}!2d${radius}!3m18!2m2!1sen!2sUS!9m1!1e2!11m12!1m3!1e2!2b1!3e2!1m3!1e3!2b1!3e2!1m3!1e10!2b1!3e2!4m6!1e1!1e2!1e3!1e4!1e8!1e6&callback=_xdc_._2kz7bz`; | |
const response = await fetch(url, { | |
headers: { | |
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/59.0.3071.109 Chrome/59.0.3071.109 Safari/537.36' | |
} | |
}); | |
const text = await response.text(); |
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)); |
NewerOlder