Skip to content

Instantly share code, notes, and snippets.

View stash's full-sized avatar
🎯
Focusing

Jeremy Stashewsky stash

🎯
Focusing
View GitHub Profile
@stash
stash / gist:0146c154c4802a0e8ea7
Created May 22, 2015 18:29
GitHub YAML highlighting fail
- this: is a yaml file
with: a top level array containing a hash
but: >
When I want to have folded text like this
where single newlines are converted into spaces
I can't have colons
like: this
or it breaks the highlighting.
@stash
stash / tough-cookie.jpg
Last active August 29, 2015 14:19
tough-cookie-logo
@stash
stash / bit-flip.js
Created November 21, 2014 02:15
CBC mode bit-flipping of IV
var crypto = require('crypto');
/*
* Pretend you've got something like this stuffed into a JSON blob. Because
* the IV is not authenticated, an attacker can alter the IV to flip arbitrary
* bits in the plaintext.
*
* Solution is to use an AEAD cipher construct,
* e.g. AES-256-GCM or AES + HMAC-SHA512/256
*/
@stash
stash / gpg-transition.txt
Created November 20, 2014 00:30
gpg key transition
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I'm transitioning GPG keys.
My old key is
pub 4096R/321F87A1 2012-06-13 [expires: 2016-06-01]
Key fingerprint = 57C8 8A18 B8A2 7183 F1D2 508D E8B2 D70F 321F 87A1
uid Jeremy Stashewsky <jeremy@goinstant.com>
@stash
stash / istanbul-mocha-package.json
Created May 22, 2014 19:48
Istanbul-Mocha integration via `npm run coverage`
{
"name": "whatever",
"version": "0.0.0",
"main": "index.js",
"scripts": {
"test": "mocha tests",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha tests"
},
"devDependencies": {
"mocha": "~1.18.2",
@stash
stash / mrb.sh
Created March 25, 2014 21:32
most-recently-used git branches (Perl one-liner)
git reflog | perl -ne 'print $1,$/ if (/checkout: moving from .+? to (.+)$/ && !$seen{$1}++)'
@stash
stash / cancellable-jobs-queue.js
Created March 11, 2014 19:54
Cancellable job queue
var async = require('async');
var q = async.queue(runner, 1);
function singular(fn) {
return function() {
if (!fn) {
return;
}
var cb = fn;

Keybase proof

I hereby claim:

  • I am stash on github.
  • I am stash (https://keybase.io/stash) on keybase.
  • I have a public key whose fingerprint is 57C8 8A18 B8A2 7183 F1D2 508D E8B2 D70F 321F 87A1

To claim this, I am signing this object:

@stash
stash / app.js
Last active August 29, 2015 13:56
SVG processor express app
var fs = require('fs');
var util = require('util');
var Transform = require('stream').Transform; // import the Transform class
var express = require('express');
var SVGO = require('svgo'); // svg optimizer - https://github.com/svg/svgo
/**
* Express setup goo goes here
*/
@stash
stash / fun-with-sinon-mocks.js
Created February 25, 2014 18:08
sinon mock object play
/*jshint node:true */
'use strict';
var assert = require('assert');
var sinon = require('sinon');
var util = require('util');
function spew(label, o) {
console.log(label, util.inspect(o, {colors:true, depth:null}));
}