Skip to content

Instantly share code, notes, and snippets.

View DimitarNestorov's full-sized avatar
📞
🔙

Dimitar Nestorov DimitarNestorov

📞
🔙
View GitHub Profile
@DimitarNestorov
DimitarNestorov / placeholder.js
Created October 24, 2017 18:55
Placeholder Generator
const placeholder = (function(){
const cache = {};
const canvas = document.createElement(`canvas`);
const type = (function(){
canvas.width = canvas.height = 100;
const context = canvas.getContext(`2d`);
context.rect(0, 0, 100, 100);
const webp = {
type: `image/webp`,
quality: 1
@DimitarNestorov
DimitarNestorov / exceptionHandler.js
Last active July 28, 2017 00:14
[$rootScope:inprog] null already in progress
function exceptionHandler(){
const error = Error;
const nullMessage = "[$rootScope:inprog] null already in progress";
function exception(message){
if(message.indexOf(nullMessage) === 0){
const $rootScope = exceptionHandler.$rootScope;
if($rootScope) $rootScope.$$phase = null;
const exception = new error(nullMessage);