Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View azproduction's full-sized avatar

Mikhail Davydov azproduction

View GitHub Profile
<a href="javascript: void $.getScript('https://gist.github.com/azproduction/5092884/raw/2e2f414b04216770b05bb3d293e8efd741e91b3d/bookmarklet.js');">500px Tiles!</a>
@azproduction
azproduction / index.js
Last active December 14, 2015 05:59
Promise-based cache
/**
* @param {String} url
*
* @return {Promise}
*/
function httpGet(url) {/*...*/}
var cache = {};
module.exports = function (url) {
// if cacne -> return
@azproduction
azproduction / 1.js
Last active December 14, 2015 02:49 — forked from padolsey/1.js
var x = '/x/';
/x/==x
@azproduction
azproduction / .gitignore
Last active December 12, 2015 12:19
LMD example for issue #105
.idea/
@azproduction
azproduction / accept_parser.js
Created December 13, 2012 09:03
Accept-Language, Accept, Accept-Encoding header parser in JavaScript http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
/**
* Accept-* header parser in JavaScript - rfc2616 sec 14.4
*
* @param {String} string Accept-*
*
* @return {Array} ordered by weight list of accepted values
*
* @example
* acceptLanguageParser('nl;q=0.6, en;q=0.8,el;q=0.4, en-US , de;q=0.2');
* // ["en-US", "en", "nl", "el", "de"]
@azproduction
azproduction / README.md
Created November 13, 2012 16:54
getBordersInViewport

Function returns sides of element that are fully in viewport

   +-----+ <- element .b-logo__image
   |     |
+--+-----+---+ <- viewport
|  |     |   |
|  +-----+   |
|            |
+------------+
var Promise = function () {
var self = this;
if (!(self instanceof Promise)) return new Promise();
self.resolveCallbacks = [];
self.rejectCallbacks = [];
self.done = false;
self.error = null;
self.value = null;
self.chain = null;
@azproduction
azproduction / README.md
Created September 24, 2012 16:42
Распределенные вычисления на JavaScript - протокол

Базовые понятия

Кластер распределенных вычислений

Один или несколько серверов объединенных одной целью

Цель: Цель кластера распределенных вычислений

Глобальная задача на которую кластер выделяет свои ресурсы

@azproduction
azproduction / LICENSE.txt
Created September 13, 2012 12:22 — forked from 140bytes/LICENSE.txt
Ugly forEach polyfill for primitives
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@azproduction
azproduction / README.md
Created September 13, 2012 12:14
Simple JSDoc Parser

Code

/*not! @jsdoc*/

/**
 * Title
 *@pewpew1 ololo
 *
 * @pewpew2 ololo