Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
d̷o̷n̷'̷t̷ ̷e̷v̷e̷n̷ ̷t̷r̷y̷ ̷t̷o̷ ̷b̷o̷t̷h̷e̷r̷ ̷m̷e̷

Svetlana Linuxenko linuxenko

💭
d̷o̷n̷'̷t̷ ̷e̷v̷e̷n̷ ̷t̷r̷y̷ ̷t̷o̷ ̷b̷o̷t̷h̷e̷r̷ ̷m̷e̷
  • ⓡⓐⓖⓤⓛⓐⓝⓓ
View GitHub Profile
View gist:f93fcd5f62085263d5a0
var DEFAULT_MAX_LISTENERS = 12
function error(message, ...args){
console.error.apply(console, [message].concat(args))
console.trace()
}
class EventEmitter {
constructor(){
this._maxListeners = DEFAULT_MAX_LISTENERS
View request-frame.md

Request frame js

// ------------------------------------
// Assorted JavaScript utility functions

function isDef(v) 			{ return v !== undefined; }
function isNull(v) 			{ return v === null; }
function isDefAndNotNull(v) { return vl != null; }
View jenkins-hash.md
function jenkinsHash(str) {
    for (var hash = 0, i = 0, len = str.length; i < len; ++i) {
        hash += (str.charCodeAt(i) >>> 0);
        hash = hash >>> 0
        hash += ((hash << 10) >>> 0);
        hash = hash >>> 0
        hash ^= ((hash >>> 6) >>> 0);
        hash = hash >>> 0
    }
View Sepia
function (r, g, b) {
var avg = 0.3 * r + 0.59 * g + 0.11 * b;
return [avg + 100, avg + 50, avg, 255];
}
@linuxenko
linuxenko / index.js
Created Feb 19, 2016 — forked from bnerd/index.js
Serve large files with Node.js
View index.js
var libpath = require('path');
var http = require('http');
var fs = require('fs');
var url = require('url');
var bind_port = 8001;
var path = "/path/to/your/base_directory/";
http.createServer(function (request, response) {
var uri = url.parse(request.url).pathname;
var filename = libpath.join(path, uri);
View webpack-babel-es6.md

webpack-config.js

/* global __dirname */

var path = require('path');

var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
View .gitmodules
[submodule "eslint"]
path = eslint
url = https://github.com/eslint/eslint
View rgb2hex
var color = {r: 186, g: 218, b: 85};
// RGB to HEX
var rgb2hex = function(r, g, b) {
return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).substr(1);
}
View index.html
<a href="https://github.com/linuxenko/usprited" target="_blank">
<img style="position: absolute; z-index:100; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>
View GIXIE Demo.markdown

GIXIE Demo

HTML5 canvas based GitHub identicons like pixel/avatar images generator library. Available as jquery plugin, es6 library or directly call it with vanillaJS.

A Pen by Svetlana Linuxenko on CodePen.

License.