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 function downscaleImage(opts) { | |
var img = opts.img; | |
var type = opts.type; | |
var quality = opts.quality; | |
var tmp = new Image(); | |
var tmp2 = new Image(); | |
var canvas, context, cW, cH; | |
type = type || 'image/jpeg'; |
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
window.onbeforeunload = function() { | |
localStorage.setItem('store', JSON.stringify(store)); | |
}; | |
const store = {}; | |
Object.assign(store, JSON.parse(localStorage.getItem('store'))); | |
export default store; |
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
app.config(function($compileProvider) { | |
if (!location.host.match(/localhost/)) { | |
$compileProvider.debugInfoEnabled(false); | |
} | |
}) |
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
System.config({ | |
"baseURL": "/", | |
"transpiler": "babel", | |
"babelOptions": { | |
"optional": [ | |
"runtime" | |
] | |
}, | |
"paths": { | |
"*": "*.js", |
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 setCaretPosition = function (elem, caretPos) { | |
var sel = window.getSelection(); | |
var range = document.createRange(); | |
range.setStart(elem.firstChild, caretPos); | |
range.collapse(true); | |
sel.removeAllRanges(); | |
sel.addRange(range); | |
}; |
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 jspm = new require('jspm'); | |
var builder = jspm.Builder(); | |
var ignorePackages = [ | |
'traceur', | |
'traceur-runtime', | |
'babel', | |
'babel-runtime' | |
]; | |
var packages = Object.keys(builder.loader.map).filter(function (pckgName){ |
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 npm = require('npm'); | |
npm.load(function(err) { | |
if (err) { | |
console.error("npm load error: ", err); | |
} | |
npm.commands.search(['array-su'], true, function(err, res) { | |
if (err) { | |
console.error("npm search error: ", err); | |
} else { | |
console.log("packages object: ", res); |
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.exports = function(config) { | |
var browser = 'PhantomJS'; | |
if (process.env.NODE_ENV === 'development') { | |
browser = 'Chrome'; //chrome is much better, because it shows properly line numbers | |
} | |
config.set({ | |
// base path, that will be used to resolve files and exclude | |
basePath: '../', |
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> | |
<!-- Angulars Material CSS now available via Google CDN; version 0.6 used here --> | |
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/angular_material/0.6.1/angular-material.min.css"> | |
<!-- Angular Material Dependencies --> | |
<script src="//cdn.jsdelivr.net/hammerjs/2.0.4/hammer.min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js"></script> |
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 lang="en"> | |
<meta charset="UTF-8"> | |
<base href="/"> | |
<title>app</title> | |
</head> | |
<body> | |
<button ng-click="loginGH()">Login</button> |