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
export default class MyPromise { | |
constructor (fn) { | |
this._callbacks = []; | |
this._done = false; | |
if(fn) fn(this.fulfill.bind(this)); | |
} | |
static all(promises) { | |
return new MyPromise(function (fulfill){ | |
var counter = promises.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
function clone(o){ | |
if(!(o instanceof Object)) return o; | |
var obj = {}; | |
for(var prop in o) { | |
if(o.hasOwnProperty(prop)) obj[prop] = clone(o[prop]); | |
} | |
return obj; | |
} |
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 that overloads a method | |
// @param {Object} obj. Object container of the method (can be first-class-object/function) | |
// @param {String} methodName. Name of the method to overload | |
// @param {Function} fn. Method that will overload. | |
// @param {Array} [paramsArr]. Array with the parameters types. OPTIONAL (recommended to always use) | |
// | |
// Examples: | |
// var obj = { method: function(){return "default method";} }; | |
// overloadMethod(obj, "method", function(a){return a;}, ["number"]); | |
// obj.method(); ==> "default method" |
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"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"> | |
<title> ... </title> | |
<link href="css/nav.css" rel="stylesheet" type="text/css"> | |
</head> | |
<body class=""> | |
<section id="nav-container" class="right"> |
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
/** | |
* This console connects to a server and sends data to be printed. | |
* | |
* @note Server must allow CORS requests. | |
* | |
* @param options {Object} Set of options to make the ajax requests. | |
* | |
* @example | |
* var c = new Console({ | |
* localhost: "10.0.1.8", |
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
// --------------------------------------------- | |
// FONT | |
// --------------------------------------------- | |
@font-face { | |
font-family: "Raleway";//-ExtraBold"; | |
src: url("../font/Raleway-ExtraBold.ttf") format("truetype"), url("../font/Raleway-ExtraBold.woff") format("woff"); | |
font-weight: 700; | |
font-style: normal; | |
} |
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
// ---- | |
// CONSTRUCTOR | |
// | |
// name: FileHandler | |
// Handles input files and reads the data. | |
// Once the file is loaded it will execute the callback with that file. | |
function FileHandler(options){ | |
if(!(window.File && window.FileReader && window.FileList && window.Blob)) throw new Error("File APIs not supported in current browser"); | |
this.elem = options.element; | |
} |
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
/* global require */ | |
"use strict"; | |
var path = require('path') | |
var fs = require('fs'); | |
var browserify = require('browserify'); | |
var through2 = require('through2'); | |
var babelify = require('babelify'); | |
var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); |
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
var toRem = (function(){ | |
var fontSize = parseFloat(window.getComputedStyle(document.querySelector("html"), null).getPropertyValue('font-size')); | |
return function toRem(px){ | |
return px/fontSize; | |
}; | |
})(); |
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"; | |
window.transformProp = (function getSupportedTransform() { | |
var prefixes = "transform WebkitTransform MozTransform OTransform msTransform".split(" "); | |
for(var i = 0; i < prefixes.length; i++) { | |
if(document.createElement("div").style[prefixes[i]] !== undefined) { | |
return prefixes[i]; | |
} | |
} | |
return false; |