Skip to content

Instantly share code, notes, and snippets.

View nalbion's full-sized avatar

Nicholas Albion nalbion

  • Sydney, Australia
View GitHub Profile
@nalbion
nalbion / PolymerTS.xml
Created February 10, 2016 11:05
IntelliJ live templates for working with PolymerTS
<!-- save to ~/.IntelliJIdea15/config/templates/PolymerTS.xml -->
<templateSet group="PolymerTS">
<template name="pe" value="&lt;dom-module id=&quot;$TITLE$&quot;&gt;&#10;&lt;style&gt;&#10;&#10;&lt;/style&gt;&#10;&lt;template&gt;&#10;$END$&#10;&lt;/template&gt;&#10;&lt;/dom-module&gt;&#10;&#10;&lt;script type=&quot;text/javascript&quot; src=&quot;$TITLE$.js&quot;&gt;&lt;/script&gt;&#10;" description="Polymer Element" toReformat="false" toShortenFQNames="true">
<variable name="TITLE" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="@comp" value="/// &lt;reference path=&quot;../bower_components/polymer-ts/polymer-ts.d.ts&quot; /&gt;&#10;&#10;@component(&quot;$TITLE$&quot;)&#10;class $CLASS_NAME$ extends polymer.Base&#10;{&#10; $END$&#10;}&#10;&#10;// after the element is defined, we register it in Polymer&#10;$CLASS_NAME$.register();" description="Pol
@nalbion
nalbion / parse-formatted-address-test.ts
Created September 26, 2019 04:55
Parse a formattedAddress
import 'mocha';
import {expect} from 'chai';
import parseFormattedAddress from './parse-formatted-address';
describe('parseFormattedAddress', () => {
it('supports addresses without country', () => {
const place = parseFormattedAddress('100 Best Road, Seven Hills NSW');
expect(place.address).to.equal('100 Best Road');
expect(place.city).to.equal('Seven Hills');