Skip to content

Instantly share code, notes, and snippets.

@avibryant
avibryant / loess.js
Created Aug 17, 2011
Loess smoothing
View loess.js
//adapted from the LoessInterpolator in org.apache.commons.math
function loess_pairs(pairs, bandwidth)
{
var xval = pairs.map(function(pair){return pair[0]});
var yval = pairs.map(function(pair){return pair[1]});
console.log(xval);
console.log(yval);
var res = loess(xval, yval, bandwidth);
console.log(res);
return xval.map(function(x,i){return [x, res[i]]});
@mbostock
mbostock / README.md
Last active Nov 10, 2021
Underscore’s Equivalents in D3
View README.md

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@mbostock
mbostock / .block
Last active Jun 17, 2017
Stacked-to-Multiples
View .block
license: gpl-3.0
@mbostock
mbostock / .block
Last active Sep 3, 2017
Concurrent Transitions
View .block
license: gpl-3.0
@biovisualize
biovisualize / index.html
Last active Oct 15, 2018
D3.js Reusable Bar Chart with Angularjs
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
.axis path, .axis line {
fill: none;
@mbostock
mbostock / .block
Last active Sep 12, 2018
TopoJSON Parallax
View .block
license: gpl-3.0
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active Dec 2, 2021
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@mbostock
mbostock / .block
Last active Dec 9, 2016
Dispatching Events
View .block
license: gpl-3.0
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Nov 27, 2021
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@soheilhy
soheilhy / nginxproxy.md
Last active Dec 6, 2021
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers