Skip to content

Instantly share code, notes, and snippets.

View CrabDude's full-sized avatar

Adam Crabtree CrabDude

View GitHub Profile
@CrabDude
CrabDude / formatStackTrace.js
Created September 22, 2011 19:07 — forked from creationix/formatStackTrace.js
Beginning of an event-source hook for system-wide stack handling hooks.
// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
@CrabDude
CrabDude / LICENSE.txt
Created May 27, 2011 16:46 — forked from 140bytes/LICENSE.txt
Force function as constructor
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// NOT AN APPLICATION, I JUST WANTED TO TAKE YOUR TEST. =)
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
// ANSWER