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 EventEmitter = require('events'); | |
const emiter_1 = new EventEmitter; | |
const emiter_2 = new EventEmitter; | |
process.nextTick(()=>console.log(0)); | |
setTimeout(()=>console.log(1), 0); | |
setImmediate(()=>console.log(2)); | |
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
" syntax enable | |
syntax on | |
set background=light | |
let g:solarized_termcolors=256 | |
colorscheme solarized | |
if &diff | |
colorscheme github | |
endif |
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 findSubsetBorders = (function(){ | |
function findSubsetBorders ( set, str ) { | |
const | |
max = set.length - 1, | |
strl = str.length, | |
low = findLowBorder( set, 0, max, str, strl); | |
return { | |
start : low, |
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
function Constr ( length ) { | |
if ( typeof length !== 'number' ) throw( | |
SyntaxError('length must be a Number') | |
); | |
this.length = length; | |
this._length = length - 1; | |
this._bin = new Array(this.length); | |
this._pointer = -1; |
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
html, body { | |
background-color : black; | |
color : lightgreen; | |
} |
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
var | |
Q = require('q'), | |
fs = require('fs'); | |
function get ( o ) { | |
var requiredLength, SOURCE; | |
if ( typeof o === 'object' ) { |
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
/** | |
* @param {...Array} sorted arrays | |
* @returns {Array} intersection of the arrays | |
*/ | |
function intersection () { | |
var arrays = [].slice.call(arguments), | |
pointers = arrays.map(function(){return 0}), | |
min = arrays[0][0], | |
result = [], |
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
/** | |
* do the array b includes all elements from the array a | |
* | |
* @param {Array} a | |
* @param {Array} b | |
* @param {Boolean} [unsorted=false] are the arrays unsorted | |
* | |
* @returns {Boolean} | |
*/ | |
function bIncludesA ( a, b, unsorted ) { |
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
// Yet Another Event Manager (Pub/Sub) | |
// | |
// all listeners are executed in context of a instance of the EventManager | |
/** | |
* @constructor | |
* | |
* @param {Boolean} [doDebug] to do 'console.error' for errors of 'listeners' or not. | |
*/ |
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
javascript:(function(){function G(){d?f(d,"opacity",0,animateDuration,function(){d.parentNode.removeChild(d);p.style.opacity=unactiveKnobOpacity;d=""}):(f(q,"opacity",0,animateDuration,function(){q.parentNode.removeChild(q);q=""}),document.body.onkeypress=M,document.body.onkeydown=wasOnkeydown,document.body.style.overflow="auto")}function y(b,c){var a={position:"fixed",zIndex:"9985",opacity:unactiveKnobOpacity,cursor:"pointer"};switch(b){case "listLeft":a.top="50%";a.left="1%";a.color="gray";a.fontSize="80px";break;case "close":a.top="3%";a.right="3%";a.color="red";a.fontSize="50px";break;case "listRight":a.top="50%",a.right="1%",a.color="gray",a.fontSize="80px"}a=r("div",a,c);a.onmouseover=function(){a.style.opacity=activeKnobOpacity};a.onmouseout=function(){a.style.opacity=unactiveKnobOpacity};return a}function H(){z();1!=imagesList[e].s?A(imagesList[e].s,H):n=s("c");h=0<e?s("l"):"";k=e<imagesList.length-1?s("r"):""}function A(b,c){0==b?(m='<img src="http://l.yimg.com/g/images/progress/balls-24x12-black.gif |