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">
<!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">
@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);
}
<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
<html>
<head>
<title>Test</title>
</head>
<body>
<p>
This page will make a CORS-enabled request for <code>https://cors-test.appspot.com/test</code> with an
Authentication header set after the service worker takes control.
</p>
@jeffposnick
jeffposnick / index.html
Created December 9, 2015 21:59
IDB test
<html>
<body>
<script src="https://cdn.rawgit.com/jakearchibald/indexeddb-promised/dd48c031e7f93d6695e89bb504cbe586dfacc073/lib/idb.js"></script>
<script>
idb.open('test', 1).then(db => {
db.transaction('key-val').objectStore('key-val').put('hello', 'world');
});
</script>
</body>
</html>