Skip to content

Instantly share code, notes, and snippets.

View rwaldron's full-sized avatar

Rick Waldron rwaldron

  • Boston, MA
View GitHub Profile
{
"dependencies": {
"johnny-five": "git+ssh://[email protected]:rwldrn/johnny-five.git"
}
}

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@rwaldron
rwaldron / interop.md
Created February 10, 2013 18:30 — forked from domenic/interop.md

module.exports = and ES6 Module Interop in Node.js

The question: how can we use ES6 modules in Node.js, where modules-as-functions is very common? That is, given a future in which V8 supports ES6 modules:

  • How can authors of function-modules convert to ES6 export syntax, without breaking consumers that do require("function-module")()?
  • How can consumers of function-modules use ES6 import syntax, while not demanding that the module author rewrites his code to ES6 export?

@wycats showed me a solution. It involves hooking into the loader API to do some rewriting, and using a distinguished name for the single export.

This is me eating crow for lots of false statements I've made all over Twitter today. Here it goes.

#####
#
# Download Baby Names and flatten into single data file
#
#####
## Setup temp files
# Not strictly necessary, but we don't need to retain the zip
names.tmpdir <- tempdir()
@rwaldron
rwaldron / spread.js
Created January 24, 2013 15:21 — forked from paultag/spread.js
/* See:
http://bit.ly/WhXvb3
for the Traceur */
var foo = [9, 9, 9],
bar = [2, 2, 2],
baz = [1, 1, ...foo, 1, 1, ...bar, 1, 1];
console.log(baz);
/* Output: 1,1,9,9,9,1,1,2,2,2,1,1 */
class Purse {
private balance;
constructor(balance = 0) {
checkNum(amount); // could also be written private.checkNum(amount)
private.balance = balance;
}
getBalance() { return balance; }
// OOP
console.log( 'OHAI'.blink() );
// Call invocation
console.log( String.prototype.blink.call('OHAI') );
// $ always makes things look awesome.
var $ = Function.prototype.call;
// Very explicit call invocation
(function (root, factory) {
'use strict';
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,
// Rhino, and plain browser loading.
if (typeof define === 'function' && define.amd) {
define(['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<video id="local" autoplay></video>
<video id="remote" autoplay></video>
<pre id="out">
</pre>
</body>
@rwaldron
rwaldron / [email protected]
Created December 3, 2012 23:10
Comparison of MultiMap with and without @NAMEs
// based on https://mail.mozilla.org/pipermail/es-discuss/2012-December/026799.html
import @iterator from '@iter';
class MultiMap {
private @keys, @vals;
constructor(iterable = []) {
this.@keys = [];
this.@vals = [];