Skip to content

Instantly share code, notes, and snippets.

View Dudemullet's full-sized avatar
🤓
//

Pipe Gutierrez Dudemullet

🤓
//
View GitHub Profile
@Dudemullet
Dudemullet / .gitconfig
Last active August 29, 2015 14:05
Open any one of your remote git repos in a browser via cli. Great after pushing changes and wanting to create a pull request. Append this to your .gitconfig file
[alias]
web = "!f(){ url=$(git config --get remote.$1.url); git web--browse $url;}; f"
# useage
# git web origin - open your remote origin repo in the browser

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>