This file contains 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
/** | |
* Created by Oleg Galaburda on 23.02.16. | |
*/ | |
var os = require('os'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var through = require('through2'); | |
var async = require('async'); | |
var vfs = require('vinyl-fs'); | |
var uglify = require('gulp-uglify'); |
This file contains 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 CSSValue { | |
static toPx(value) { | |
CSSValue._element.style.fontSize = value; | |
return window.getComputedStyle(CSSValue._element).fontSize; | |
} | |
static toInt(value) { | |
return parseInt(CSSValue.toPx(value)); | |
} |
This file contains 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
// Uses Node, AMD or browser globals to create a module. | |
(function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(['jquery'], factory); | |
} else if (typeof module === 'object' && module.exports) { | |
// Node. Does not work with strict CommonJS, but | |
// only CommonJS-like environments that support module.exports, | |
// like Node. | |
module.exports = factory(require('jquery')); |
This file contains 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
/** | |
node server | |
http://localhost:8081 | |
*/ | |
(function(express){ | |
this.use(express.static('.')); | |
this.listen(8081, function(){ | |
console.log('Server started...'); | |
}); | |
}).apply(require('express')(), [require('express')]); |
This file contains 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
// ==UserScript== | |
// @name FB I Saw This! | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Permanently hide story from FB news feed when its scrolled out. | |
// @author a_[w] | |
// @match https://www.facebook.com/ | |
// @grant none | |
// ==/UserScript== |
This file contains 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 AbstractCallableObject { | |
constructor() { | |
return (...args) => this.apply(this, args); | |
} | |
apply(target, args) { | |
this.call(target, ...args); | |
} | |
/*abstract*/ call(target, ...args) { |
This file contains 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'; | |
export default class Pixels { | |
/* | |
_image = null; | |
_data = null; | |
_width = null; | |
_height = null; | |
*/ | |
constructor(imageData) { |
This file contains 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'; | |
/** | |
* Original HSL <> RGB, HSV <> RGB transformation algorithms can be found here: | |
* https://gist.github.com/mjackson/5311256 | |
*/ | |
const COLOR_PART = 1 / 0xff; | |
const HUE_PART = 1 / 6; |
This file contains 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
const handlerFactory = (sub = null) => { | |
const handlers = []; | |
const handler = (...args) => { | |
for (let handler of handlers) { | |
handler.apply(null, args); | |
} | |
}; | |
handler.add = (sub) => { | |
if (sub !== handler && sub instanceof Function && handlers.indexOf(sub) < 0) { | |
handlers.push(sub); |
This file contains 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'; | |
import Pixels from 'Pixels'; | |
import {HSBA, RGBA} from 'Color'; | |
const pixels = new Pixels(); | |
const hsba = new HSBA(); | |
const PI_2 = Math.PI * 0.5; |
OlderNewer