Skip to content

Instantly share code, notes, and snippets.

var util = require('util');
var fs = require('fs');
var data = [
'/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcH',
'Bw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/',
'2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e',
'Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCAAQABADASIAAhEBAxEB/8QA',
'HwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUF',
'BAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK',
(function () {
var a, b, c;
function d() {}
// Is there an object, "???" that will let us enumerate thru
// the locals, "a", "b", "c", and "d"?
for (var k in ???) {
}
})()
@broofa
broofa / gist:1071842
Created July 8, 2011 13:36
Differential Scrollifier Bookmarklet
== THE BOOKMARKLET ==
javascript: (function(){var a=function(s){return document.querySelectorAll(s)[0].style;},b=JX.copy;b(a('.differential-add-comment-panel h1'),{display:'none'});b(a('.differential-add-comment-panel'),{position:'fixed',bottom:'0px',width:'100%',zIndex:'100',overflow:'auto',maxHeight:'400px'});b(a('.differential-primary-pane'),{paddingBottom:'445px'});})()
== FORMATTED SOURCE ==
(function() {
var a = function(s) {
return document.querySelectorAll(s)[0].style;
}, b = JX.copy;
apply: (Prototype.Browser.IE ? function(o, a) {
a = a || [];
switch (a.length) {
case 0: return this.call( o);// \ "FUUU...!"
case 1: return this.call( o,a[0]);// \ _
case 2: return this.call( o,a[0],a[1]);// \ \o
case 3: return this.call( o,a[0],a[1],a[2]);// /\_
case 4: return this.call( o,a[0],a[1],a[2],a[3]);// \ /\
case 5: return this.call( o,a[0],a[1],a[2],a[3],a[4]);// > /
case 6: return this.call( o,a[0],a[1],a[2],a[3],a[4],a[5]);// >
@broofa
broofa / jsscore.js
Created July 5, 2012 22:05
JS-Score Reference Implementation
/**
* Compute a jsscore for the current JS environment
*
* @param n (Number) Number of iterations to run. For best results this value
* should be selected such that the run time is between 0.1 and
* 0.5 seconds. The default (1,000,000) will fall well short of
* this on modern devices. This is by design so as to prevent
* unintentional CPU contention, but will likely yield inaccurate
* results.
*
@broofa
broofa / robot.js
Created December 5, 2012 02:05
Broobot
var Robot = function(robot) {};
var ds = 1;
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.rotateCannon(ds++);
robot.fire();
<!DOCTYPE html />
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script>
// Array of items to display
var items = [];
// (Re)render the list of items
function renderList() {
Dear Mr. Kieffer:
Thank you for contacting me with your thoughts on gun control laws. I appreciate your taking the time to get in touch. My prayers are with the victims, their families, and the people of Orlando after this senseless, horrible attack.
When I was in the Oregon legislature, I supported a successful effort to enact legislation improving our gun safety laws, and now in Congress I want to ensure that we are enforcing the gun laws we have on the books. The fact is that there are some people who cannot and should not own guns, either because of their criminal background or mental health needs.
The system we already have in place for this exact purpose—the National Instant Criminal Background Check System (NICS)—has facilitated millions of firearms background checks in collaboration with the FBI. This is an important tool for our law enforcement agencies, but as of now it is not being used to its full potential: of the over 2.1 million denials for attempted illegal purchases, only a tiny fracti
((((()(()(((((((()))(((()((((()())(())()(((()((((((()((()(()(((()(()((())))()((()()())))))))))()((((((())((()))(((((()(((((((((()()))((()(())()((())((()(()))((()))()))()(((((()(((()()))()())((()((((())()())()((((())()(()(()(((()(())(()(())(((((((())()()(((())(()(()(()(())))(()((((())((()))(((()(()()(((((()()(()(((()(((((())()))()((()(()))()((()((((())((((())(()(((())()()(()()()()()(())((((())((())(()()))()((((())))((((()())()((((())((()())((())(())(((((()((((()(((()((((())(()(((()()))()))((((((()((())()())))(((()(()))(()()(()(((()(()))((()()()())((()()()(((())())()())())())((()))(()(()))(((((()(()(())((()(())(())()((((()())()))((((())(())((())())((((()(((())(())((()()((((()((((((()(())()()(()(()()((((()))(())()())()))(())))(())))())()()(())(()))()((()(()(())()()))(()())))))(()))(()()))(())(((((()(()(()()((())()())))))((())())((())(()(())((()))(())(((()((((((((()()()(()))()()(((()))()((()()(())(())())()(()(())))(((((()(())(())(()))))())()))(()))()(()(((((((()((((())))())())())())()((((((((((((((()()((((((()()(
@broofa
broofa / commit-msg
Created October 28, 2016 17:04 — forked from wesbos/commit-msg
ESLint 3.0 Git Pre Commit Hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
failed=0
for file in ${files}; do