Skip to content

Instantly share code, notes, and snippets.

View azproduction's full-sized avatar

Mikhail Davydov azproduction

View GitHub Profile
@azproduction
azproduction / LICENSE.txt
Created December 13, 2011 13:56 — forked from 140bytes/LICENSE.txt
Lazy (and synchronous) Module Declaration in 126 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mikhail Davydov
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 / LICENSE.txt
Created August 3, 2011 16:10 — forked from 140bytes/LICENSE.txt
Browser detection script v3.0
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 azproduction
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 / gist:1292557
Created October 17, 2011 13:03
Simple Google Dart HTTP Server
/**
* Simple HTTP server on Dart
* @see http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/runtime/bin/socket_impl.dart
* http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/runtime/bin/socket_stream.dart
*
* Based on http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/samples/socket/SocketExample.dart
* @author azproduction
*/
class HttpExample {
/**
*
* @param {String} moduleName module name or path to file
*/
function require(moduleName) {}
/**
* Matches in-package modules
*
* @param {RegExp} regExp
@azproduction
azproduction / event.js
Last active December 16, 2015 11:09
yet another EventManager
function EventManager () {
this._events = {};
}
EventManager.prototype = {
_event: function (type) {
var events = this._events[type];
if (!events) {
events = this._events[type] = {};
<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 / README.md
Created November 13, 2012 16:54
getBordersInViewport

Function returns sides of element that are fully in viewport

   +-----+ <- element .b-logo__image
   |     |
+--+-----+---+ <- viewport
|  |     |   |
|  +-----+   |
|            |
+------------+