Skip to content

Instantly share code, notes, and snippets.

> object
Object {touch-action: "none"}
> Object.getOwnPropertyDescriptor(object, 'touch-action')
Object {value: "none", writable: true, enumerable: true, configurable: true}
> o = Object.create(object)
Object {} <-- where's my proto?
> Object.create({'touch-action': 'none'})
<!doctype html>
<html>
<head>
<title></title>
<style>
html, body {
height: 100%;
}
body {
font-family: 'Helvetica Neue', Roboto, Arial, Helvetica, sans-serif;
ready: function() {
this.resizeListeners = [];
if (!this.fire('request-resize-advice', {sender: this, ok: false}, this.parentNode).ok) {
console.log('using window resize');
window.addEventListener('resize', this.resize.bind(this));
} else {
console.log('using ancestor resize');
}
},
requestResizeAdvice: function(event, detail) {
explodeObservers: function(prototype) {
// called before prototype.observe is chained to inherited object
var o = prototype.observe;
if (o) {
var exploded = {};
for (var n in o) {
var names = n.split(' ');
for (var i=0, ni; ni=names[i]; i++) {
exploded[ni] = o[n];
}
E:\www\bowertopia>bower install Polymer/polmer-elements#master
bower polmer-elements#master not-cached git://github.com/Polymer/polmer-elements.git#master
bower polmer-elements#master resolve git://github.com/Polymer/polmer-elements.git#master
bower platform#master cached git://github.com/Polymer/platform.git#2b99a84638
bower platform#master validate 2b99a84638 against git://github.com/Polymer/platform.git#master
bower polmer-elements#master ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/Polymer/p
olmer-elements.git", exit code of #128
Additional error details:
fatal: remote error:
@sjmiles
sjmiles / gist:8478807
Created January 17, 2014 18:28
Dynamic loading imports in Polymer circa 1/17/2014. Will be very much streamlined shortly.
loadLinks: function(urls, callback) {
var doc = document.createDocumentFragment();
urls.forEach(function(url) {
var link = doc.appendChild(document.createElement('link'));
link.rel = "import";
link.href = url;
});
// load-all-links in document method should be factored somewhere
// very similar method used in x-meta
HTMLImports.importer.load(doc, function() {
@sjmiles
sjmiles / gist:9282062
Last active August 29, 2015 13:56
One History of `document.registerElement`

As I understand it, the original Custom Elements concept had a crystalline form: attach a class to a tag-name.

Using the yet-to-be ES6 syntax, it would look something like this:

  class MyElement extends HTMLElement {
    constructor() {
    }
    doStuff() {
 }
<template>
<style>
what-goes-here /content/ *:not([top]) [text] {
color: transparent;
}
</style>
@sjmiles
sjmiles / test.md
Created March 31, 2014 19:32
test

Test

Sweet.

@sjmiles
sjmiles / test.md
Created March 31, 2014 19:35
test

Test

Sweet.