Skip to content

Instantly share code, notes, and snippets.

View Dudemullet's full-sized avatar
🤓
//

Pipe Gutierrez Dudemullet

🤓
//
View GitHub Profile

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

d3.legend

d3.legend is a quick hack to add a legend to a d3 chart. Simply add a g and .call(d3.legend). Any elements that have a title set in the "data-legend" attribute will be included when d3.legend is called. Each title will appear only once (even when multiple items define the same data-legend) as the process uses a set based on a existing names, not an array of all items.

Color

By default the color in the legend will try to match the fill attribute or the stroke attribute of the relevant items. Color can be explicitly defined by attribute "data-legend-color"

Order

The order of items in the legend will be sorted using the top of the bounding box for each included item. The order can be explicitly defined by attribute "data-legend-pos"

@Dudemullet
Dudemullet / index.html
Created May 11, 2014 21:57
Server simple video stream
<!doctype html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
</head>
@Dudemullet
Dudemullet / index.html
Created April 29, 2012 07:19
basic d3 example
<html>
<head>
<title>Simple D3 demo</title>
</head>
<body>
<div id="myDiv">
</div>
<script type="text/javascript" src="https://raw.github.com/mbostock/d3/master/d3.v2.js"></script>
<script type="text/javascript">