Skip to content

Instantly share code, notes, and snippets.

<link rel="import" href="../components/polymer/polymer.html">
<link rel="import" href="../components/core-icon-button/core-icon-button.html">
<polymer-element name="post-card">
<template>
<style>
:host {
display: block;
position: relative;
background-color: white;
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="google-youtube-video-wall">
<template>
<style>
:host {
position: absolute;
@jeffposnick
jeffposnick / unresolved.html
Last active August 29, 2015 14:06
Demonstrates using `unresolved` on a wrapper element, and putting a "Loading..." indicator outside of that.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Polymer Demo</title>
<style>
.hidden {
display: none;
}
</style>
<html>
<head>
<title>Demo</title>
</head>
<body>
Will it float?
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="A Material Design card list built with Polymer.">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<!-- See https://www.chromestatus.com/feature/5398016231997440 -->
<meta name="theme-color" content="#0277db">
@jeffposnick
jeffposnick / test.js
Last active October 21, 2015 16:56
Using Promises to wait for UI actions
function waitForLogin(message) {
return new Promise(function(resolve) {
if (alreadyLoggedIn) {
resolve();
} else {
if (message) {
showMessage(message);
}
addEventListener('logged-in', resolve);
}
<!doctype html>
<html>
<head>
<title>Polymer 1.0.2 Template</title>
<script src="https://cdn.rawgit.com/webcomponents/webcomponentsjs/master/webcomponents.js"></script>
<link rel="import" href="https://cdn.rawgit.com/Polymer/polymer/v1.0.2/polymer.html">
</head>
<body>
<template is="dom-bind" id="page-template">
<html>
<head>
<title>Video src issue</title>
</head>
<body>
<p>
Playing the video will trigger a network request for
<code>https://ia800502.us.archive.org/10/items/WebmVp8Vorbis/webmvp8.webm</code>.
The <code>ia800502.us.archive.org</code> server doesn't support CORS, but when there is no SW
@jeffposnick
jeffposnick / index.html
Last active August 25, 2020 11:50
Exploration of how a service worker's fetch handler affects the DevTools Network panel
<html>
<head>
<title>DevTools Test</title>
</head>
<body>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
// Wait until the SW has taken control of the page before inserting the <script> elements.
// That way we can be sure the SW's fetch handler will intercept them.
<html>
<body>
<p><button onclick="fetch('a');">fetch a</button></p>
<p><a href="b">go to b</a></p>
<script>
navigator.serviceWorker.register('sw.js');
</script>
</body>
</html>