Skip to content

Instantly share code, notes, and snippets.

@mttmccb
mttmccb / app.html
Last active October 26, 2017 12:07
Guard Limits on number input
<template>
<require from="./range-number-value-converter"></require>
<label>Page Number</label>
<input type="number" value.bind="pageNumber"><br>
<label>Page Number using ValueConverter</label>
<input type="number" value.bind="anotherPageNumber | rangeNumber:0:100">
</template>
@mttmccb
mttmccb / another-home.html
Last active October 23, 2017 12:08 — forked from jdanyow/app.html
canDeactivate check
<template>
<h1>Another home</h1>
<p>The grass is not greener <a route-href="route: home">take me back</a>.</p>
</template>
@mttmccb
mttmccb / sample.ts
Last active September 26, 2017 18:18 — forked from chanakaDe/sample.ts
import {autoinject} from 'aurelia-framework';
import {HttpClient} from "aurelia-fetch-client";
import {Steam} from './steam';
import {BaseI18N, I18N} from 'aurelia-i18n';
import {EventAggregator} from 'aurelia-event-aggregator';
@autoinject()
export class Producers extends BaseI18N {
producers = 'Producers Page!';
@mttmccb
mttmccb / app.html
Last active September 19, 2017 13:58
Optional attributes attributes
<template>
<h1>${message}</h1>
<input ref="input" disabled.bind="isDisabled" placeholder="readonly" max-length.bind="maxLength">
</template>
@mttmccb
mttmccb / app.html
Created February 18, 2017 22:28
Aurelia Ref Width
<template>
<div ref="appcontainer" style="width: 150px; border: 1px solid red;">
<p>App width is ${elementwidth}</p>
<p>div width is ${divwidth}</p>
</div>
</template>
@mttmccb
mttmccb / app.html
Last active January 28, 2017 23:13 — forked from jdanyow/app.html
Aurelia Ref Width
<template>
<div ref="appcontainer" style="width: 150px; border: 1px solid red;">
<p>App width is ${elementwidth}</p>
<p>div width is ${divwidth}</p>
</div>
</template>
@mttmccb
mttmccb / app.html
Last active January 26, 2017 21:38
Aurelia Slot
<template>
<require from="./man-with-no-name"></require>
<require from="./western-extra"></require>
<man-with-no-name>Sometimes the dead can be more useful than the living.</man-with-no-name>
<western-extra>
<h1 slot="outfit">dead man's shoes</h1>
<h2 slot="weapon">rifle</h2>
</western-extra>
@mttmccb
mttmccb / app.html
Created January 18, 2017 09:32 — forked from Thanood/app.html
Aurelia-Materialize bridge select bind onjects
<template>
<div>
<select md-select value.two-way="selectedMeal">
<option disabled selected>Select your meal</option>
<option repeat.for="meal of food" model.bind="meal">${meal.name}</option>
</select>
<a md-button="flat: true;" md-waves click.trigger="setSelectedMeal()" class="accent-text">select steak</a>
You selected: ${selectedMeal | stringify}
</div>
@mttmccb
mttmccb / import.rb
Last active December 14, 2016 21:50 — forked from spiffytech/import.rb
Imports a Squarespace dump into Jekyll
# coding: utf-8
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'safe_yaml'
require 'time'
require 'uri'
require 'open-uri'
@mttmccb
mttmccb / countries.sql
Created September 23, 2015 07:39 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;