Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Component.extend({
html: `<div>
<img src="https://via.placeholder.com/350x150" width="350" height="150" alt="Placeholder" />
</div>`,
});
import Ember from 'ember';
export default Ember.Controller.extend({
appData : {
"title" : "First Title",
"subtitles": [
{
"AMount":"4343"
},
{
@mansona
mansona / parseDuration.js
Created August 22, 2011 13:50 — forked from sj26/parseDuration.js
Parses a natural duration string into seconds.
// Try to be as sensible as possible about parsing durations
function parseDuration(duration) {
// .75
if (match = /^\.\d+$/.exec(duration)) {
return parseFloat("0" + match[0]) * 3600;
// 4 or 11.75
} else if (match = /^\d+(?:\.\d+)?$/.exec(duration)) {
return parseFloat(match[0]) * 3600;
// 01:34
} else if (match = /^(\d+):(\d+)$/.exec(duration)) {