Skip to content

Instantly share code, notes, and snippets.

View jasmith79's full-sized avatar

Jared Adam Smith jasmith79

View GitHub Profile
import { LitElement, html, css } from 'lit-element';
export const LitstrapButton = class LitstrapButton extends LitElement {
static get properties() {
return {
kind: {
type: String,
reflect: true,
},
size: {
@jasmith79
jasmith79 / trueequals.js
Created August 18, 2017 15:14
JavaScript Value Equality
/*
* Checks to items to see if they are equal in terms of value. For primitives
* that's easy with one exception, but reference types are harder.
*
* For the purposes of this gist I've defined equality for reference types as
* follows:
*
* Regexes, dates, and functions are equal if their string representations are
* equal.
* WeakMaps, WeakSets, and Generators are equal only if they are referentially
@jasmith79
jasmith79 / runtest.js
Created April 12, 2016 16:18
How to run jQuery against promises A+ test suite in nodejs
var tester = require('promises-aplus-tests');
var jq = require('jquery');
var jsdom = require('jsdom');
jsdom.env('<p></p>', function(err, window) {
if (err != null) {
throw err;
} else {
var $ = jq(window);
var arg = {
deferred: $.Deferred