Skip to content

Instantly share code, notes, and snippets.

View dandean's full-sized avatar
🌧️
It's raining.

Dan Dean dandean

🌧️
It's raining.
View GitHub Profile
import args from "assert-args";
// Annotate functions for argument warnings in non-production environments:
@args({ bar: String, baz: Function })
function foo(bar, baz) {
}
foo();
// Argument Warning: expected bar to be String, found undefined
// Argument Warning: expected baz to be Function, found undefined
@dandean
dandean / es6.js
Last active August 29, 2015 14:17
Holy shit private members!
var foo = Symbol('foo');
class MyClass {
constructor() {
// Calling a private method!!!
this[foo]();
}
[foo]() {
alert('FOOOOOO!!!!!!');
@dandean
dandean / spaces.js
Last active August 29, 2015 14:09
The theory that tab characters grant us the ability to have self-determined indent widths breaks down whenever a file contains content which is meant to be vertically aligned.
var foo = "foo",
bar = "bar";
# make node_modules/
node_modules/: package.json
npm install
@dandean
dandean / link.sh
Last active August 29, 2015 14:04
Link a module to itself to get around relative require hell.
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
[11:55:12] <@dandean> Found an incorrect variable declaration in that last PR. Caught it in canary!
[11:55:15] <@oscar> mimi, its an experience
[11:55:22] <@dandean> Fix is going to canary right now.
[11:55:25] <tOm> WRITE A REGRESSION TEST
[11:55:49] <@oscar> YEAH! If the tests didnt catch it, your tests gotta be better
[11:56:35] <@dandean> you are correct sirs
[11:56:53] <@oscar> tom and I are sitting our desks chanting "tests tests tests tests"
[11:56:54] <@dandean> it's in a controller template helper – those can be a bit annoying to test.
[11:57:01] <whilp> the noise is deafening
[11:57:07] <whilp> all of alder is yelling "TESTS"

Keybase proof

I hereby claim:

  • I am dandean on github.
  • I am dandean (https://keybase.io/dandean) on keybase.
  • I have a public key whose fingerprint is A6CD 88BF 7F39 C9A9 9C44 C8F9 F8B9 E337 82CB B1A8

To claim this, I am signing this object:

var x = 5, y = 10;
console.log(`${x} + ${y} = ${ x + y}`);
// 5 + 10 = 15