Skip to content

Instantly share code, notes, and snippets.

@timrwood
timrwood / update.md
Created February 10, 2014 21:10
red-django 0.2.0 and red-static 0.2.1

Update red-django and red-static.

$ npm update -g generator-red-static generator-red-django

Or, install them if you hadn't done so yet.

test('Testing a component', function () {
var component = App.ExampleButtonComponent.create({
layoutName : 'components/example-button'
});
Ember.run(function () {
component.append();
});
equal(component.$('.is-not-enabled').length, 1, 'Should show the .is-not-enabled element');
@timrwood
timrwood / api.md
Created May 22, 2014 15:41
Moment Timezone API

Formats

// Packed
"America/Los_Angeles|PST PDT|70 60|010101010101|-h234i0 fgd0 wef0 fgd0 wef0 fgd0 wef0"

// Unpacked
{
	name    : "America/Los_Angeles",
	abbrs   : ["PST", "PDT", "PST", "PDT", "PST", "PDT", "PST", "PDT", "PST", "PDT"],
@timrwood
timrwood / process.md
Created May 31, 2014 01:26
Moment Timezone Data Update Process

1. Download from iana.org/time-zones

temp/download/northamerica
temp/download/africa
temp/download/...

2. Compile with zic(8)

moment.tz.add(
{
"links": {
"Africa/Asmera": "Africa/Asmara",
"Africa/Timbuktu": "Africa/Bamako",
"America/Argentina/ComodRivadavia": "America/Argentina/Catamarca",
"America/Atka": "America/Adak",
"America/Buenos_Aires": "America/Argentina/Buenos_Aires",
"America/Catamarca": "America/Argentina/Catamarca",
"America/Coral_Harbour": "America/Atikokan",
manager dist manifest export ignore include entry
npm npm package.json cjs .npmignore #main
bower git bower.json umd #ignore #main
component git component.json umd #files #main
spm git package.json#spm umd .spmignore #output #main
packagist git composer.json umd
ender npm package.json cjs .npmignore #ender
dojo ??? package.json#dojoBuild umd #dojoBuild
jspm npm/git package.json#jspm any #ignore #files #main
var momento = moment(556095600000); // 1987-08-16T07:00:00.000Z
var day = momento.date(); // 16
var month = momento.month() + 1; // 8
var year = momento.year(); // 1987
var timeperiods = {
year : moment(year, "YYYY").toISOString(), // 1987-01-01T08:00:00.000Z
month : moment(month + "-" + year, "MM-YYYY").toISOString(), // 1987-08-01T07:00:00.000Z
day : moment(day + "-" + month + "-" + year, "DD-MM-YYYY").toISOString() // 1987-08-16T07:00:00.000Z
}
* { outline: 1px solid red; }
*:before { outline: 1px dotted #800000; }
*:after { outline: 1px dashed #ff8080; }
* * { outline: 1px solid #ff4d00; }
* *:before { outline: 1px dotted #802600; }
* *:after { outline: 1px dashed #ffa680; }
* * * { outline: 1px solid #ff9900; }
* * *:before { outline: 1px dotted #804d00; }
* * *:after { outline: 1px dashed #ffcc80; }
* * * * { outline: 1px solid #ffe500; }
@timrwood
timrwood / grouped-by-offsets.js
Last active August 29, 2015 14:21
Alternate moment timezone current timezone filters.
}
function matchesAtIndex (zone, i) {
var aDay = 50 * 24 * 60 * 60 * 1000;
if (i < zone.offsets.length - 1 && new Date(zone.untils[i] + aDay).getTimezoneOffset() !== zone.offsets[i + 1]) {
// console.log(zone.name, new Date(zone.untils[i] + aDay).getTimezoneOffset(), zone.offsets[i + 1], '+1');
// console.log(zone.name, zone.untils[i + 1], aDay, zone.untils[i + 1] + aDay);
return false;
}
// console.log(zone.name, new Date(zone.untils[i] - aDay).getTimezoneOffset(), zone.offsets[i]);
@timrwood
timrwood / 2015a.js
Created May 13, 2015 14:32
Moment Timezone Data
moment.tz.load({
"version": "2015a",
"zones": [
"Africa/Abidjan|LMT GMT|g.8 0|01|-2ldXH.Q",
"Africa/Accra|LMT GMT GHST|.Q 0 -k|012121212121212121212121212121212121212121212121|-26BbX.8 6tzX.8 MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE",
"Africa/Addis_Ababa|LMT EAT BEAT BEAUT|-2r.g -30 -2u -2J|01231|-1F3Cr.g 3Dzr.g okMu MFXJ",
"Africa/Algiers|PMT WET WEST CET CEST|-9.l 0 -10 -10 -20|0121212121212121343431312123431213|-2nco9.l cNb9.l HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 DA0 Imo0 rd0 De0 9Xz0 1fb0 1ap0 16K0 2yo0 mEp0 hwL0 jxA0 11A0 dDd0 17b0 11B0 1cN0 2Dy0 1cN0 1fB0 1cL0",
"Africa/Bangui|LMT WAT|-d.A -10|01|-22y0d.A",
"Africa/Bissau|LMT WAT GMT|12.k 10 0|012|-2ldWV.E 2xonV.E",
"Africa/Blantyre|LMT CAT|-2a.k -20|01|-2GJea.k",