Skip to content

Instantly share code, notes, and snippets.

View christianbundy's full-sized avatar

Christian Bundy christianbundy

  • 07:10 (UTC -07:00)
View GitHub Profile
# IMPORTANT - CHANGE ME (unless you have the Chromebook Pixel 2015)
export BOARD=samus
sudo aptitude install -y git-core gitk git-gui subversion curl
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
cat > /tmp/sudo_editor <<EOF
#!/bin/sh
@christianbundy
christianbundy / stegosploit.html
Last active August 29, 2015 14:22
Source HTML for Stegosploit proof-of-concept by Saumil Shah.
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE-Edge">
<style>
body { visibility: hidden; }
img { visibility: visible; }
</style>
<script src="elephant3.jpg"></script>
</head>
<body>
def answer(x):
len_x = len(x)
modifier = (sum(x) / float(len_x)) % 1
modifier = modifier if modifier <= 0.5 else 1 - modifier
return int(len_x - len_x * modifier)
def expect(expected, actual):
assert expected is actual, \
"expected: {}, actual {}".format(expected, actual)
@christianbundy
christianbundy / auto-google-foobar.js
Created April 29, 2015 04:14
Probably automatically gets you into Google Foobar. Probably.
// to be run on https://docs.python.org/3.5/reference/
// (probably works on other versions of the docs) (probably)
var topics = [];
var links = document.getElementsByTagName("a");
for (var i in links) {
if (links.hasOwnProperty(i)) {
var link = links[i];
var text = link.innerText;
if (typeof text === 'string') {
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
margin: 0;
background: #111;
min-width: 960px;
}
#!/usr/bin/env bash
trap 'exit' ERR # exit on error (better than `set -e`)
set -x # echo commands before running
set -u # throw error if an unbound variable is called
BASEDIR=$(cd $(dirname $0) && pwd) # path to directory for itself
LOGDIR="$BASEDIR/times" # directory for logging
LOGFILE="$LOGDIR/times.txt" # file for logging (within $LOGDIR)
#!/bin/bash
MIN=0
MAX=1
STEPS=100
RANGE=$(echo "$MAX - $MIN" | bc -l)
INC=$(echo "$RANGE / $STEPS" | bc -l)
fade () {
var system = require('system');
var address = 'http://stress-test.meteor.com';
var i = 0;
var stopping = false;
var newThread = function () {
console.log(i++);
var t = Date.now();
@christianbundy
christianbundy / exports.js
Last active August 29, 2015 14:02
Export variables to the global namespace with `module.exports` in the browser (or anywhere else). Example in the comments!
// Initialize an empty module object
module = {};
// Functions created this way don't inherit strict mode
exports = Function('return this')();
// Define what happens when you try to get or set `module.exports`
Object.defineProperty(module, 'exports', {
// Extend the top-level object with the object that's passed
set: function (obj) {
var strict = function (fn) {
'use strict';
var args;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var ARG_NAMES = /([^\s,]+)/g;
var fnStr = fn.toString().replace(STRIP_COMMENTS, '');
args = fnStr.slice(fnStr.indexOf('(')+1, fnStr.indexOf(')')).match(ARG_NAMES);