Skip to content

Instantly share code, notes, and snippets.

View dfreedm's full-sized avatar

Daniel Freedman dfreedm

View GitHub Profile
@dfreedm
dfreedm / Keybase.md
Created March 13, 2020 04:36
Keybase.md

Keybase proof

I hereby claim:

  • I am dfreedm on github.
  • I am dfreedm (https://keybase.io/dfreedm) on keybase.
  • I have a public key ASAYytHy5O5ES0jEtRcQTq1YOQ83mg_njh3WLjX494J-Qwo

To claim this, I am signing this object:

@dfreedm
dfreedm / index.html
Created May 7, 2018 23:54
mwc-icon example
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@next/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">
import 'https://unpkg.com/@material/mwc-icon@latest/mwc-icon.js?module';
@dfreedm
dfreedm / axe-report.js
Last active March 26, 2018 21:28
Axe A11y Reporting for Mocha
async function axeReport(dom, config = {}) {
const {cleanup, axeConfig} = config;
const {violations} = await axe.run(dom, axeConfig || {
runOnly: ['wcag2a', 'wcag2aa', 'section508'],
// we don't care about passing tests
resultTypes: ['violations']
});
await cleanup();
if (!violations.length) {
return;
@dfreedm
dfreedm / gulp.js
Last active July 26, 2016 17:41
polymer-css-build gulp wrapper
/**
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
@dfreedm
dfreedm / bower2git.js
Created August 31, 2015 21:55
Replace PolymerElement bower components with their github equivalents
#!/usr/bin/env node
/**
* @license
* Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
@dfreedm
dfreedm / README.md
Last active August 26, 2015 05:32
Rough Draft of a Push Manifest Generator

Usage

node index.js /path/to/app/folder index.html

Output

An flat list of HTML Imports, Scripts, and Styles for putting into a Push manifest

@dfreedm
dfreedm / date-combo-box.html
Last active August 29, 2015 14:19
Slotted Redistribution Question
<!-- Reference implementation for date-combo-box
Reference link: https://github.com/w3c/webcomponents/wiki/Proposal-for-changes-to-manage-Shadow-DOM-content-distribution/641b524e633678c2b25e7cb8ba31005350f36c9d#proposal-part-2-filling-and-re-exposing-named-insertion-points
-->
<!-- For date-combo-box, which inherits from combo-box -->
<template>
<input type="date" content-slot="inputElement">
<img src="calendarIcon.png" content-slot="icon">
<month-calendar content-slot="dropdown"></month-calendar>
</template>
@dfreedm
dfreedm / irving.js
Created April 8, 2015 19:27
Example of removing <head> and <body> with dom5
#!/usr/bin/env node
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../notification-elements/notification-alert.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;