Skip to content

Instantly share code, notes, and snippets.

Jarrod Overson jsoverson

Block or report user

Report or block jsoverson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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);
@jsoverson
jsoverson / electron-puppeteer.js
Created Mar 28, 2019
Example of automating VS Code with puppeteer
View electron-puppeteer.js
const childProcess = require('child_process');
const puppeteer = require('puppeteer');
const request = require('request-promise-native');
var delay = require('timeout-as-promise');
function spawn(port) {
return childProcess.spawn(
// '/Applications/Visual\ Studio\ Code\ -\ Insiders.app/Contents/MacOS/Electron',
'/Applications/Visual Studio Code.app/Contents/MacOS/Electron',
[
@jsoverson
jsoverson / puppeteer-request-echo.js
Created Mar 26, 2019
Puppeteer echo request headers
View puppeteer-request-echo.js
const puppeteer = require('puppeteer');
(async() => {
const browser = await puppeteer.launch({
});
const page = (await browser.pages())[0];
const response = await page.goto('http://scooterlabs.com/echo.json');
@jsoverson
jsoverson / puppeteer-prettier.js
Last active Aug 2, 2019
Intercept and prettify every script
View puppeteer-prettier.js
const puppeteer = require('puppeteer');
const prettier = require('prettier');
const atob = require('atob');
const btoa = require('btoa');
const requestCache = new Map();
const urlPatterns = [
'*'
]
@jsoverson
jsoverson / puppeteer-cdp-base.js
Created Feb 22, 2019
Puppeteer base with CDP sessions on every tab
View puppeteer-cdp-base.js
const puppeteer = require('puppeteer');
async function initializeCDP(page) {
const client = await page.target().createCDPSession();
}
(async function main(){
const browser = await puppeteer.launch({
headless:false,
@jsoverson
jsoverson / puppeteer-base.js
Created Feb 22, 2019
Base puppeteer script
View puppeteer-base.js
const puppeteer = require('puppeteer');
(async function main(){
const browser = await puppeteer.launch({
headless:false,
defaultViewport:null,
devtools: true
});
const page = (await browser.pages())[0];
You can’t perform that action at this time.