Skip to content

Instantly share code, notes, and snippets.

View stramel's full-sized avatar

Michael Stramel stramel

View GitHub Profile
0499c6fe28b49b1a02276ce841b8d838b31e5900d7eb342c7c6ae05df8c783383d570ed887a071d40e5ecd9f80161f831e4fd2c7b62fe320eb8456aea0538e8d1b;admwx7
@stramel
stramel / hax-blox.html
Last active November 9, 2017 07:48
Polymer 2 Element for dynamically switching out templates with slots
<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../polymer/lib/utils/import-href.html">
<dom-module id="hax-blox">
<template></template>
<script>
class haxBlox extends Polymer.Element {
static get is() {
return 'hax-blox';
}
@stramel
stramel / browserlist
Created August 16, 2017 20:20
Polymer Gulp multiple builds
last 3 versions
not Explorer < 11
not ExplorerMobile < 11
@stramel
stramel / reflection.js
Created June 21, 2017 02:50
A couple options
Polymer.__importLazyGroup = function(
callingElement, group, fromElement, options) {
if (!fromElement) {
fromElement = Polymer.DomModule.import(callingElement.localName);
}
var importStatuses = {loaded: [], failed: []};
var groupAttribute = group ? '[group=' + group + ']' : ':not([group])';
var query =
'link' +groupAttribute+ '[rel=\'lazy-import\'][href]:not([href=\'\'])';
@stramel
stramel / .eslintrc.js
Last active June 13, 2017 15:16
Linter files
module.exports = {
'extends': ['eslint:recommended', 'google'],
'env': {
browser: true,
es6: true
},
'globals': {
Polymer: true
},
'rules': {
<!doctype html>
<head>
<base href="https://polygit.org/polymer+:2.0-preview/webcomponentsjs+webcomponents+:v1/custom-elements+webcomponents+*/shadydom+webcomponents+*/shadycss+webcomponents+*/components/">
<script src="webcomponentsjs/webcomponents-loader.js"></script>
<link href="polymer/polymer-element.html" rel="import">
</head>
<body>
<script id="jsbin-source-html" type="text/html"><!doctype html>
@stramel
stramel / index.html
Created February 22, 2017 17:00
PSK Fix for Polymer Undefined
<!--
@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
-->
@stramel
stramel / keymap.cson
Created December 20, 2016 20:10
Atom Keybindings
'body':
'ctrl-shift-s': 'window:save-all'
'.workspace .editor':
'ctrl-d': 'editor:duplicate-lines'
'ctrl-shift-D': 'editor:delete-line'
'.editor':
'alt-shift-right': 'editor:select-to-end-of-line'
'alt-right': 'editor:move-to-end-of-line'
@stramel
stramel / css-var-polyfill.js
Created September 6, 2016 21:48
CSS Variable Polyfill
/*
TODO:
X Maybe account for defaults: color: var(--header-color, blue);
- Verify cross domain working or not (it is working from dropbox)
- Option to wait to apply anything until all <link>s are parsed or inject what we have and update as each <link> returns
- Need to test on a more complex CSS file
- Option to save parsed file in local/session storage so there isn't a delay on additional page loads. Could only do it for links (with URLs to use as keys) and style blocks with IDs of some sort
- Need to test more complex values like rgba(255,0,0,0.5); and something with !important
- Try multiple links
- Local links
@stramel
stramel / STYLES.md
Last active March 29, 2016 13:52
Collection of various articles

CSS Style Suggestions

PX, EM, REM

  • Use em for media queries Read More
  • When to use rem vs em? Read More
    • Size in em if the property scales according to it's font-size
  • Size everything else in rem