Skip to content

Instantly share code, notes, and snippets.

View akc42's full-sized avatar

Alan Chandler akc42

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes, shrink-to-fit=no">
<title>Grid Issue</title>
<style>
html {
background: #ffffff;
@akc42
akc42 / custom-input.js
Created January 4, 2019 16:52
Custom Input using Decorator Pattern.
import { LitElement, html } from '../../node_modules/@polymer/lit-element/lit-element.js';
import {ifDefined} from '../../node_modules/lit-html/directives/if-defined.js';
import {classMap} from '../../node_modules/lit-html/directives/class-map.js';
import {render} from '../../node_modules/lit-html/lib/shady-render.js';
let inputCounter = 0;
class CustomInput extends LitElement {
static get properties() {
return {
@akc42
akc42 / host.js
Created September 11, 2018 12:30
Page management
export default function domHost(self) {
let parent = self.parentNode;
while(parent && parent.nodeType !== 11) {
parent = parent.parentNode; //work up the hierarchy
}
return parent ? parent.host : self;
}
@akc42
akc42 / web.js
Created May 31, 2018 14:08
Server basics
(function() {
'use strict';
const path = require('path');
const fs = require('fs');
const enableDestroy = require('server-destroy');
const UAParser = require('ua_parser');
const url = require('url');
const etag = require('etag');
@akc42
akc42 / PolymerSetup.js
Last active February 7, 2018 14:03
Polymer Testing
(function(){
var PolymerTests = {};
//I am not sure if we can just do this once, or for every test. I am hoping just once
var script = document.createElement("script");
script.src = "/base/components/platform/platform.js";
document.getElementsByTagName("head")[0].appendChild(script);
var POLYMER_READY = false;
beforeEach(function(done){