Skip to content

Instantly share code, notes, and snippets.

Jesse Printz jonypawks

Block or report user

Report or block jonypawks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jonypawks on github.
  • I am jprintz (https://keybase.io/jprintz) on keybase.
  • I have a public key ASBsioH8tDpr93NcUh2slME9LscqRuVEKFr_mGy8M4eiWgo

To claim this, I am signing this object:

@jonypawks
jonypawks / README.md
Last active Dec 27, 2015
D3 and Nested SVG Elements.
View README.md

README

An example of using nested svg elements to have different coordinate systems in the same visualization. In this case, we provide a histogram of random data that fills the width of the graph while keeping the title in a static size for easy reading.

@jonypawks
jonypawks / gist:7192173
Created Oct 28, 2013
Coffeescript UUID4
View gist:7192173
_random =
if crypto?.getRandomValues
-> crypto.getRandomValues(new Uint32Array(1))[0] / Math.pow(2, 32)
else
Math.random
uuid4 = ->
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace /[xy]/g, (c) ->
u = _random() * 16 | 0
u = u & 0x3 | 0x8 if c is 'y'
View README.md

This example demonstrates brush transitions, a new feature in D3 3.3.

Try dragging the brush or selecting a new region. When you mouseup, the brush transitions smoothly back to its original position. The transition is initiated simply by applying the brush to a transition (rather than a selection), similar to automatic axis transitions. Note that interacting with the brush interrupts the current transition!

View gist:1886114
document.getElementById("tabVendor").onTabClick = function() { InitVendor() }
View output.txt
from timeit import timeit
zipmethod = """dict(zip(sample[::2], sample[1::2]))"""
formethod = """\
d = dict()
for i in range(1, len(sample) - 1, 2):
d[sample[i]] = sample[i+1]
"""
if __name__ == '__main__':
You can’t perform that action at this time.