Skip to content

Instantly share code, notes, and snippets.

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
}
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
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",
@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)

@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 / popout.txt
Last active November 21, 2019 15:22
YouTube and Vimeo video player popout bookmarklett
javascript:!function(){var h=location.href,y=h.match(/(youtu.be\/|v\/|u\/\w\/|embed\/|v=)([^#\&\? ]*).*/),v=h.match(/(vimeo.com\/)([^#\&\? ]*)/);y=y&&'http://www.youtube.com/watch_popup/?v='+y[2];v=v&&'http://player.vimeo.com/video/'+v[2];window.open(y||v,"_blank","height=345,width=560");}()
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 / 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.

alias fact="elinks -dump randomfunfacts.com | grep '|' -B 2 -A 2"
alias p='fact && git pull --rebase'
alias up='fact && git push'
function () {
var last = null;
this.get('content').forEach(function (item) {
item.set('prev', last);
item.set('next', null);
if (last) {
last.set('next', item);
}
last = item;
});