Skip to content

Instantly share code, notes, and snippets.

@jsoverson
jsoverson / Configuration.h
Created October 2, 2020 17:35
Ender 3 Pro Marlin 2.x config
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@jsoverson
jsoverson / random-obfuscated.js
Last active August 14, 2020 14:34
Generic obfuscated JavaScript file
var _0x4fa2 = [
'zgvMAw5LuhjVCgvYDhK=',
'x19LC01VzhvSzq==',
'y29TCg91BMrbC3nPz25Tzw50t3bLCMf0B3jnyxa=',
'Dw5HCNLpCgvYyxrVCK1HCa==',
'yMLUyxj5t3bLCMf0B3jnyxa=',
'pt09',
'it09',
'Aw5ZDgfUy2vVzG==',
'pJ4+',
Array
.from(document.querySelector('#main_table_countries_yesterday > tbody').children)
.filter(x => !x
.querySelector(['us', 'germany', 'norway', 'sweden', 'denmark'].map(x => `a[href*='country/${x}']`)))
.forEach(x => x.parentElement.removeChild(x))
import { Puppeteer } from 'puppeteer/lib/Puppeteer';
import findRoot from 'find-root';
import path from 'path';
import { initializePuppeteer } from 'puppeteer/lib/index';
const puppeteer = initializePuppeteer({
packageJson: require(path.join(findRoot(require.resolve('puppeteer')), 'package.json')),
rootDirectory: findRoot(require.resolve('puppeteer')),
});
@jsoverson
jsoverson / index.js
Created November 13, 2019 01:31
Chrome Dev Summit's BigWebQuiz automation script
const puppeteer = require("puppeteer");
async function launch() {
const browser = await puppeteer.launch({
args: ["–proxy-server=<<secret>>"]
});
const page = await browser.newPage();
await page.authenticate({
(function () {
class c {
constructor(d) {
this.target = d;
}
greet() {
console.log("Hello " + this.target);
}
setTarget(e) {
this.target = e;
var a = [
"\x73\x65\x74\x54\x61\x72\x67\x65\x74",
"\x77\x6f\x72\x6c\x64",
"\x72\x65\x61\x64\x65\x72",
"\x74\x61\x72\x67\x65\x74",
"\x67\x72\x65\x65\x74",
"\x6c\x6f\x67",
"\x48\x65\x6c\x6c\x6f\x20"
];
(function(c, d) {
@jsoverson
jsoverson / js-identifiers.js
Created July 10, 2019 15:15
Hacking JS with JS medium post
const { traverse } = require("shift-traverser");
module.exports = function(ast) {
const ids = [];
traverse(ast, {
enter(node, parent) {
if (node.type === "VariableDeclarator") {
if (node.binding.type === "ObjectBinding") {
node.binding.properties.forEach(prop => ids.push(prop.binding.name));
if (node.binding.rest) ids.push(node.binding.rest.name);
@jsoverson
jsoverson / screenshot.js
Created June 20, 2019 16:27
Example puppeteer setup for Joe McCann
const puppeteer = require('puppeteer');
const config = {
entryUrl: '',
auth: {
email: '',
emailSelector: '',
password: '',
passwordSelector: '',
submitButtonSelector: ''
class GeneralSet {
map = new Map();
constructor(a = []) {
this[Symbol.iterator] = this.values;
if (a) a.forEach(_ => this.add(_));
}
add(el) {
this.map.set(el.toIdString(), el);