Skip to content

Instantly share code, notes, and snippets.

View jennasalau's full-sized avatar

Jenna Salau jennasalau

  • Deloitte
  • Melbourne, Australia
View GitHub Profile
@jennasalau
jennasalau / Self-XSS-Warning.js
Created May 31, 2018 23:31
Social Engineering Self-XSS Warning Like Facebook
if (process.env.NODE_ENV === 'production') {
if (typeof window !== 'undefined' && typeof console === 'object' && typeof console.log === 'function') { // eslint-disable-line no-console
console.log('%cWARNING!', 'color:white; background:red; font-size: 16pt'); // eslint-disable-line no-console
console.log('%cThis is a browser feature intended for developers. Using this console may allow attackers to impersonate you and steal your information. Do not enter or paste code that you do not understand.', 'font-size: 14pt'); // eslint-disable-line no-console
}
}
@jennasalau
jennasalau / check-engine.js
Created February 8, 2018 07:32
Quick and dirty script to verify node and npm "engine" versions defined in `package.json` (Note it ignores patch numbers)
#!/usr/bin/env node
const exec = require("child_process").exec;
const pkg = require('../package.json');
// Helper script that ensures developers are using the same node versions
function runVersionCommand(command, callback) {
exec(command, function(execError, stdin, stderr) {
const commandDescription = JSON.stringify(command);
@jennasalau
jennasalau / gist:e4ac25f2a4e659bdefbeee15bde77ecc
Created July 28, 2017 00:27
Delete all local tracked branches except master and develop
git branch | grep -v master | grep -v develop | xargs git branch -D