Skip to content

Instantly share code, notes, and snippets.

@jebeck
jebeck / .block
Last active February 6, 2017 01:23
overlay experiment
license: mit
@jebeck
jebeck / README.md
Last active August 4, 2016 08:01
profile a Python module with hotshot

Python Hotshot Profiler

Just a quick script to profile any Python module (filename passed in as a command-line arg; has to have a main()) using hotshot. Logs to stdout.

@jebeck
jebeck / .gitignore
Last active August 29, 2015 14:24
SVG groups as hooks for interaction
.DS_Store
@jebeck
jebeck / index.html
Last active August 29, 2015 14:23
bar chart without groups
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.9.3/lodash.min.js"></script>
<style type="text/css">
body {
margin: 0;
}
@jebeck
jebeck / index.html
Last active August 29, 2015 14:23
the tiniest bar chart
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.9.3/lodash.min.js"></script>
<style type="text/css">
body {
margin: 0;
}
@jebeck
jebeck / bootstrap.min.css
Last active August 29, 2015 14:23
how big is too big?
/*!
* Bootstrap v3.3.4 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box
@jebeck
jebeck / README.md
Last active August 29, 2015 14:10
Zipline-style virtual rendering on scroll

Zipline-style virtual rendering on scroll

A toy example to demonstrate the scrolling with virtual rendering implemented in zipline.

@jebeck
jebeck / README.md
Last active August 29, 2015 14:10
Tideline-style virtual scrolling

Tideline-style virtual scrolling

A toy example to demonstrate the virtual scrolling implemented in tideline.

@jebeck
jebeck / README.md
Last active August 29, 2015 14:10
Browser-zoom robust foreignObject tooltips

Browser-zoom robust foreignObject tooltips in SVG

Based on this previous gist, but robust to changes in browser zoom level (text inside tooltip doesn't get cut off when zoom < 100%).

@jebeck
jebeck / README.md
Last active August 29, 2015 14:04
The Zipfian desert of Homeric vocabulary.

The Zipfian desert of Homeric vocabulary.

A visualization to demonstrate how the frequency of vocabulary items (lemmas) in Homer follows a Zipfian distribution (at least for all open, non-functional cateogories). Here lemmas occuring 25 times or less are excluded for performance reasons.

For more information, see Zipf's Law.