Skip to content

Instantly share code, notes, and snippets.

@leumasme
leumasme / 0_info.md
Last active January 17, 2024 15:54
Javascript: Array.down() and Array.up()

Array.up() and Array.down() let you do semi-basic array processing without nesting Array.map() calls.
This is a silly thing I made in 20 minutes because I thought it would be cursed. You probably shouldn't actually use it.
Somewhat inspired by vectorized functions in python.

@leumasme
leumasme / extractor.js
Created May 31, 2023 21:00
Twitter API GraphQL ID List
// Add a webpack module to get the module export cache
(webpackChunk_twitter_responsive_web.push([[''],{},e=>{
window.moduleCache = [];
for(let c in e.c) {
window.moduleCache.push(e.c[c]);
}
}]));
// Find API definitions in the module cache
window.moduleCache.filter(x=> typeof x.exports == "object" && "queryId" in x.exports).map(x=>[x.exports.operationName,x.exports.queryId])
@leumasme
leumasme / a_version.md
Last active April 24, 2023 00:59
minecraft java edition required java editions according to the manifest files
Range Start Range End Java Version
1.18 1.19.4 17
1.17 1.17.1 16
1.0 1.16.5 8
@leumasme
leumasme / words.txt
Created March 30, 2023 23:18
subdomain scan wordlist
This file has been truncated, but you can view the full file.
mail
mail2
www
ns2
ns1
blog
localhost
m
ftp
@leumasme
leumasme / promise_fulfilled_polyfill.js
Created October 6, 2021 10:06
Promise.fulfilled polyfill, to check if a Promise was completed
Promise = new Proxy(Promise, {
construct(target, args) {
let p = new target(...args)
p.fulfilled = false;
p.then(()=>p.fulfilled = true)
p.catch(()=>p.fulfilled = true)
return p;
}
})
@leumasme
leumasme / onbeforescriptexecute.js
Last active July 4, 2022 18:46 — forked from maple3142/onbeforescriptexecute.js
polyfill of 'beforescriptexecute' event
// 'beforescriptexecute' event with loadPayloadSync
// original version: https://gist.github.com/jspenguin2017/cd568a50128c71e515738413cd09a890
;(function () {
'use strict';
class Event {
constructor(script, target) {
this.script = script;
this.target = target;