This file contains hidden or 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
class ExpiringDataCache { | |
private _cache: any[] = []; | |
public expirationTime = 100; | |
set cache(value: any) { | |
this.expiredCache.push({value, ttl: Date.now() + this.expirationTime}); | |
} | |
get cache() { | |
return this.expiredCache.map(item => item.value); |
This file contains hidden or 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
/** | |
* @module namespace/Closure | |
* @requires module:namespace/Model | |
* @lends namespace | |
*/ | |
(function (window) { | |
'use strict'; | |
/** | |
* @namespace |
This file contains hidden or 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> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.5.5/webcomponents-lite.min.js"></script> | |
<link rel="import" href="my-component.html" /> | |
<link rel="import" href="my-component-input.html" /> | |
<link rel="import" href="my-component-extend.html" /> | |
</head> |
This file contains hidden or 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 ExtendedArray() { | |
let arr = []; | |
arr.push.apply(arr, arguments); | |
/** | |
* Returns a circulating range of an Array | |
* @param index {Number} starting position | |
* @param size {Number} size of the range | |
* @param [reverse] {Boolean} reverse the range lookup | |
* @return {Array} The returned array length will not exceed the length of the original array if size > arr.length |
This file contains hidden or 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
'use strict'; | |
var path = require('path'), | |
fs = require('fs'), | |
matchdep = require('matchdep'); | |
module.exports = function (grunt) { | |
var gruntConfig = { | |
pgk: grunt.file.readJSON('package.json'); | |
}; |
This file contains hidden or 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> | |
<style> | |
html, | |
body { | |
height: 100%; | |
width: 100%; | |
} | |
.wrapper { |
This file contains hidden or 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 ExtendedArray() { | |
let arr = []; | |
arr.push.apply(arr, arguments); | |
arr.pos = 0; | |
arr.prev = function () { | |
return this[this.pos = (this.pos || this.length)-1]; | |
}; | |
arr.next = function () { | |
return this[this.pos = (++this.pos % this.length)]; | |
}; |
This file contains hidden or 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
Prototyper = {}; | |
Prototyper.create = function (base) { | |
var empty = function () {}; | |
empty.prototype = base; | |
return new empty(); | |
}; | |
Prototyper.xtends = function (parent, instance) { | |
instance.prototype = this.create(parent.prototype); | |
instance.prototype.constructor = instance; | |
instance.prototype.__super__ = parent; |