Skip to content

Instantly share code, notes, and snippets.

View Nevraeka's full-sized avatar

Erik Isaksen Nevraeka

View GitHub Profile
@rniwa
rniwa / gist:2f14588926e1a11c65d3
Last active August 29, 2015 14:19
Imperative API for Node Distribution in Shadow DOM

Imperative API for Node Distribution in Shadow DOM

There are two approaches to the problem depending on whether we want to natively support redistribution or not.

To recap, a redistribution of a node (N_1) happens when it's distributed to an insertion point (I_1) inside a shadow root (S_1), and I_1's parent also has a shadow root which contains an insertion point which ends picking up N_1. e.g. the original tree may look like:

(host of S_1) - S_1
  + N_1         + (host of S_2) - S_2
                   + I_1           + I_2
@zdarovka
zdarovka / Usage.html
Last active April 18, 2018 05:58
Pageable-content element based on core-list
<st-pageable-content id="pageableContent"
urltemplate="/Episodes/Page-{page}" appurltemplate="/serials/{page}" currentpage="{{currentPage}}" dataname="episode"
data="{{data}}" width="400" height="170" grid on-core-activate="{{selectView}}">
<template>
<st-episode-tile data="{{model}}"></st-episode-tile>
</template>
</st-pageable-content>
<polymer-element name="st-pageable-content" attributes="urlTemplate appUrlTemplate dataname currentPage" extends="core-list">
<template>
<style>
:host {
display: block;
height: 100%;
}
</style>
<content></content>
@nrn
nrn / react-internals.md
Last active April 1, 2018 18:02
Notes for react internals discussion.

react internals discussion

React: a robust functional view layer.

View code and templating are combined as JavaScript.

In JavaScript you create a virtual DOM, react diffs changes between the last virtual DOM and the next, mutating the real DOM only as necessary to reflect the changes. This has huge implications for cognitive