Skip to content

Instantly share code, notes, and snippets.

View aubergene's full-sized avatar

Julian Burgess aubergene

View GitHub Profile
@aubergene
aubergene / rotate.js
Last active September 9, 2016 20:41
underscore array rotate
/**
* Underscore function to rotate an array
* See also _.cycle https://gist.github.com/901648
*
* _.rotate([1, 2, 3, 4, 5]);
* => [2, 3, 4, 5, 1]
* _.rotate([1, 2, 3, 4, 5], 3);
* => [4, 5, 1, 2, 3]
* _.rotate([1, 2, 3, 4, 5], -3);
* => [3, 4, 5, 1, 2]
@aubergene
aubergene / index.html
Created January 26, 2013 21:25
Circular key (similar to axis) v1
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
body {
font: 10px sans-serif;
margin: 0;
}
@aubergene
aubergene / circle-legend.js
Last active December 17, 2019 20:28
D3 Circular Legend
// Adapted from https://github.com/mbostock/d3/blob/master/src/svg/axis.js
var circleLegend = function() {
'use strict';
var scale,
orient = 'left',
tickPadding = 3,
tickExtend = 5,
tickArguments_ = [10],
tickValues = null,
@aubergene
aubergene / README.md
Last active December 15, 2015 06:09
rangeRoundBands v rangeBands

I was confused how rangeRoundBands differed from rangeBands so made this example

@aubergene
aubergene / README.md
Last active August 15, 2016 13:36
Simple JavaScript Scale

I love D3's Quantitative Scales and wanted a simple way to create and use scales in that style.

Example

var centigradeToFahrenheit = new Scale().domain(-40, 0).range(-40, 32);
var fahrenheitToCentigrade = new Scale().domain(-40, 32).range(-40, 0);

centigradeToFahrenheit(35); // 95 hot!
@aubergene
aubergene / base58.js
Created January 28, 2014 21:56 — forked from inflammable/base58.js
Base58
/*
* base58.js
* - encodes integers to and decodes from a base58 (or your own) base58 alphabet
* - based on Flickr's url shortening
*
* usage:
* base58.encode(integer);
* base58.decode(string);
*
* (c) 2012 inflammable/raromachine
@aubergene
aubergene / .block
Last active October 23, 2019 22:09
Centigrade to Fahrenheit
license: cc-by-4.0
@aubergene
aubergene / keybase.md
Created April 16, 2014 03:43
keybase proof

Keybase proof

I hereby claim:

  • I am aubergene on github.
  • I am aubergene (https://keybase.io/aubergene) on keybase.
  • I have a public key whose fingerprint is CFF8 6FAB 5F1B A3A5 0640 7579 94D4 9589 076F 86CF

To claim this, I am signing this object:

@aubergene
aubergene / README.md
Last active February 10, 2016 16:56
Vector networks
@aubergene
aubergene / .block
Last active August 29, 2016 20:19
Barbican logo
---
border: "no"
license: cc-by-4.0