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 (...protectedMembers) { | |
const currentUserID = new URL('file://' + JSON.parse(document.getElementById("__eqmc").innerHTML).u).searchParams.get('__user'); | |
if (!protectedMembers || !Array.isArray(protectedMembers) || protectedMembers.length <= 0 || !protectedMembers.includes(currentUserID)) throw Error(`Add your ID (${currentUserID}) to protected members or you will delete yourself`) | |
async function navigateAndRun() { | |
try { | |
const [, name, rest] = /^\/groups\/([\w\d.]+)(\/.+)?$/.exec(document.location.pathname); | |
if (rest !== "/people/members") { | |
alert("Navigating to correct page, rerun the script there"); | |
document.location.pathname = `/groups/${name}/people/members`; | |
} |
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
export class BufferWithPointer { | |
public pointer = 0 | |
constructor(private buf: Buffer) {} | |
private len = this.buf.length | |
/** | |
* Sets the buffer pointer, the address at which next parse will begin. | |
* @throws {RangeError} if this will put pointer outside of `0..=len` range. | |
* @param {number} addr What index to go to | |
* @returns {number} the previous pointer, before setting |
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 pug = require('pug') | |
const hljs = require('highlight.js') | |
const beautify = require('js-beautify') | |
const includes = {} | |
Object.assign(includes, { | |
$pug: str => pug.render(str, includes), | |
$highlight: lang => | |
lang === 'auto' | |
? str => hljs.highlightAuto(str).value |