Skip to content

Instantly share code, notes, and snippets.

View yangjunjun's full-sized avatar
🐱
Focusing

杨军军 yangjunjun

🐱
Focusing
  • undefined
  • Xian, Shaanxi, China
View GitHub Profile
@mbostock
mbostock / .block
Last active January 31, 2024 11:52
Hexagonal Binning (Color)
license: gpl-3.0
redirect: https://observablehq.com/@d3/d3-hexbin
@cbrammer
cbrammer / installer.js
Created October 19, 2012 22:42
NPM Sucks
var npm = require('npm')
, pack = require('./package.json')
, modules = {}
;
if(pack.dependencies) build(pack.dependencies);
if(pack.optionalDependencies) build(pack.optionalDependencies);
if(pack.devDependencies) build(pack.devDependencies);
function build(dependancies) {
@feross
feross / gist:1936676
Created February 29, 2012 01:00
memoizer.js
var count = 0;
var memoizer = function(memo, formula) {
var recur = function(n) {
var result = memo[n];
if (typeof result !== "number") {
result = formula(n);
memo[n] = result;
}
return result;
@addyosmani
addyosmani / memoize.js
Created September 18, 2011 16:33
memoize.js - a faster JavaScript memoizer
/*
* memoize.js
* by @philogb and @addyosmani
* further optimizations by @mathias
* Released under an MIT license.
*/
function memoize( fn ) {
return function () {
var args = Array.prototype.slice.call(arguments),
hash = "",
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//