Skip to content

Instantly share code, notes, and snippets.

@SeanMcMillan
SeanMcMillan / Multiple.js
Created October 29, 2010 18:55
Examples of one return versus multiple returns
// Multiple returns -- totally unreadable.
function findWaldo() {
var ret;
if (isInKitchen()) return "kitchen";
if (isInBedroom()) return "bedroom";
if (isInGarage()) return "garage";
//check the dom elements he could be hiding in
for(var i = 0; i < 100; i++) {
@SeanMcMillan
SeanMcMillan / gist:6088521
Created July 26, 2013 12:34
Attempting to load browser-js on node. I can make a fake window and load it, but if I turn `global` into the fake window, it fails with vm.runInNewContext(source, fakewindow); ^ ReferenceError: window is not defined
'use strict';
var fakewindow;
var fakedocument, fakenode;
fakedocument = {
createDocumentFragment: function() {
return {
appendChild: function() {}
};
},
@SeanMcMillan
SeanMcMillan / thoughts.txt
Created October 12, 2013 13:51
Thoughts on sexual assault at conferences.
So, let's talk about sexual assault at conferences.
If you don't understand why agreeing to X is not agreeing to Y afterwards, please have yourself committed. You're dangerous.
A Code of Conduct would not have helped. It would have been ignored, just like decency was ignored.
(CoCs often come with escalation policies, and staff training. _Those_ are probably helpful. But only at the con.)
The Police and Justice system are a giant failure, hence the creation of community pseudo-police and quasi-justice.