This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { action, computed, set, get, setProperties } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
init() { | |
super.init(...arguments); | |
this.set('model', { | |
endsAt: 'some value', | |
totalBudget: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import { set } from '@ember/object'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
someObj: { a: 1 }, | |
init() { | |
this._super(...arguments); | |
this.someProp = this.someObj; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ComponentOne from './component-one'; | |
import ComponentA from '../mixins/component-a'; | |
export default ComponentOne.extend(ComponentA, { | |
type: 'Component Five', | |
description: 'Extends Component One and includes Component A. Overrides obj in definition.', | |
obj: { | |
val: 5 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ComponentOne from './component-one'; | |
import ComponentA from '../mixins/component-a'; | |
export default ComponentOne.extend(ComponentA, { | |
type: 'Component Five', | |
description: 'Extends Component One and includes Component A. Overrides obj in definition.', | |
obj: { | |
val: 5 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Progress Bar</title> | |
</head> | |
<style type="text/css"> | |
#progress-bar { | |
background-color: blue; | |
height: 30px; | |
border-radius: 2px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="outer"> | |
<div class="middle"> | |
<div class="inner"> | |
<h1>The Content</h1> | |
<p>Once upon a midnight dreary...</p> | |
</div> | |
</div> | |
</div> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.topics-menu__topic-submenu.topic-design { | |
background-color: #c42915 | |
} | |
.topics-menu__topic-submenu.topic-code { | |
background-color: #005d50 | |
} | |
.topics-menu__topic-submenu.topic-music { | |
background-color: #0235c0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (start,length){start=start||0;if(start<0)start=this.length+start;length=length||(this.length-start);var newArray=[];for(var i=0;i<length;i++)newArray[i]=this[start++];return newArray} VM2066:4 | |
function (item){var i=0;var len=this.length;while(i<len){if(this[i]===item){this.splice(i,1);len--}else{i++}}return this} VM2066:4 | |
function (item,from){return this.indexOf(item,from)!=-1} VM2066:4 | |
function (keys){var obj={},length=Math.min(this.length,keys.length);for(var i=0;i<length;i++)obj[keys[i]]=this[i];return obj} VM2066:4 | |
function (array){for(var i=0,j=array.length;i<j;i++)this.push(array[i]);return this} VM2066:4 | |
function (array){for(var i=0,l=array.length;i<l;i++)this.include(array[i]);return this} VM2066:4 | |
function include(object) { | |
if (Object.isFunction(this.indexOf)) | |
if (this.indexOf(object) != -1) return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** OOP in JS ***/ | |
// No Classes in JavaScript, but constructor functions. | |
var a = 5; | |
// is equivalent to calling | |
var a = Number(5); // JavaScript abstracts it. | |
// Number is a Constructor Function | |
// A Class. First letter caps only for symantics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!Function.prototype.bind) { | |
Function.prototype.bind = function (oThis) { | |
// closest thing possible to the ECMAScript 5 internal IsCallable | |
// function | |
if (typeof this !== "function") | |
throw new TypeError( | |
"Function.prototype.bind - what is trying to be fBound is not callable" | |
); |
NewerOlder