Skip to content

Instantly share code, notes, and snippets.

class Notification {
constructor() {
this.notifyIDs = [];
let template = `<header role="header"><i role="button">Close</i></header><main role="main"></main>`;
let style = `
<style>
:host {
max-width: 350px !important;
min-width: 260px !important;
@egnedko
egnedko / fit_adjust.js
Created April 24, 2017 10:58 — forked from mohamedmansour/fit_adjust.js
FIT Algorithm for resizing photos.
/**
* Adjust the resolution by scaling the height and width to fit the current
* width and height of the pane.
*
* @param {string} originalResolution the resolution in object format
* @param {string} maxResolutionthe resolution in object format
*
* @author Mohamed Mansour (http://mohamedmansour.com)
*/
var adjustResolution = function(originalResolution, maxResolution) {
@egnedko
egnedko / esnextbin.md
Last active December 14, 2016 15:09
esnextbin sketch
@egnedko
egnedko / Queue.js
Created November 1, 2016 15:23
Realisation Queue on js
class Queue extends Array {
constructor (STACKSIZE = Number.MAX_SAFE_INTEGER, ...arg) {
super(...arg)
Object.defineProperty(this, 'STACKSIZE', {
value: STACKSIZE
})
this.enqueue = this.enqueue.bins(this);
this.dequeue = this.dequeue.bind(this);
@egnedko
egnedko / Stack.js
Last active March 21, 2017 21:39
Realisation Stack on js
class Stack extends Array {
constructor(STACKSIZE = Number.MAX_SAFE_INTEGER, ...arg) {
super(...arg);
Object.defineProperty(this, 'STACKSIZE', {
value: STACKSIZE
})
this.push = this.push.bind(this);
this.pop = this.pop.bind(this);
@egnedko
egnedko / css_resources.md
Last active August 29, 2015 14:14 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@egnedko
egnedko / Attribute [download]
Created November 17, 2014 09:57
Download something with JS
a = createElement('a');
a.setAttribute('href', 'data:text/plain;base64,SGVsbG8gd29ybGQK'); // Hello Word
a.setAttribute('download', 'file');
a.click();
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true