Skip to content

Instantly share code, notes, and snippets.

@jsoverson
jsoverson / Configuration.h
Created Oct 2, 2020
Ender 3 Pro Marlin 2.x config
View Configuration.h
/**
* 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 Aug 14, 2020
Generic obfuscated JavaScript file
View random-obfuscated.js
var _0x4fa2 = [
'zgvMAw5LuhjVCgvYDhK=',
'x19LC01VzhvSzq==',
'y29TCg91BMrbC3nPz25Tzw50t3bLCMf0B3jnyxa=',
'Dw5HCNLpCgvYyxrVCK1HCa==',
'yMLUyxj5t3bLCMf0B3jnyxa=',
'pt09',
'it09',
'Aw5ZDgfUy2vVzG==',
'pJ4+',
View console.js
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))
@jsoverson
jsoverson / local-puppeteer.ts
Created Jun 17, 2020
Using puppeteer@4.0.0 with typescript
View local-puppeteer.ts
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 Nov 13, 2019
Chrome Dev Summit's BigWebQuiz automation script
View index.js
const puppeteer = require("puppeteer");
async function launch() {
const browser = await puppeteer.launch({
args: ["–proxy-server=<<secret>>"]
});
const page = await browser.newPage();
await page.authenticate({
View deobfuscated.js
(function () {
class c {
constructor(d) {
this.target = d;
}
greet() {
console.log("Hello " + this.target);
}
setTarget(e) {
this.target = e;
View obfuscated.js
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 Jul 10, 2019
Hacking JS with JS medium post
View js-identifiers.js
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 Jun 20, 2019
Example puppeteer setup for Joe McCann
View screenshot.js
const puppeteer = require('puppeteer');
const config = {
entryUrl: '',
auth: {
email: '',
emailSelector: '',
password: '',
passwordSelector: '',
submitButtonSelector: ''
View general-set.js
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);