Skip to content

Instantly share code, notes, and snippets.

@qm3ster
qm3ster / delete-all-members.js
Last active March 25, 2024 20:02
Delete all members from a Facebook group
(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`;
}
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
@qm3ster
qm3ster / index.js
Created September 19, 2017 17:19
requirebin sketch
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