Skip to content

Instantly share code, notes, and snippets.

View enjoylife's full-sized avatar
📖

Matthew Clemens enjoylife

📖
View GitHub Profile
@enjoylife
enjoylife / ssh-id_rsa.pub
Created November 8, 2012 22:33
Password-less SSH
1. Generate keys on local machine: `ssh-keygen`
2. Create `~/.ssh` directory on remote machine
3. Copy `local:~/.ssh/id_rsa.pub` to `user@remote:~/.ssh/authorized_keys`
method a) `ssh-copy-id -i ~/.ssh/id_rsa.pub user@host`
method b) cat .ssh/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Force-Directed Graph</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.25.0"></script>
<style type="text/css">
// create a 2d array
function createGrid(rows, columns) {
var grid = new Array(rows);
for(var i = 0; i < rows; i++) {
grid[i] = new Array(columns);
for(var j = 0; j < columns; j++) {
grid[i][j] = 0;
}
}
return grid;
/**
* Circular Tooltip (SO)
* http://stackoverflow.com/q/13132864/1397351
*/
* { margin: 0; padding: 0; }
body {
overflow: hidden;
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg);
}
/* generic styles for button & circular menu */
/*
* Partial applied functions in C
* Leandro Pereira <leandro@tia.mat.br>
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
@enjoylife
enjoylife / README.md
Last active December 21, 2015 02:39 — forked from mbostock/.block
configurable and robust line chart
@enjoylife
enjoylife / canvas.js
Created August 14, 2013 23:31 — forked from mbostock/.block
(function() {
var po = org.polymaps;
po.canvas = function() {
var canvas = po.layer(load, unload),
image = po.svg("image"), // dummy image
url;
function load(tile) {
var size = canvas.map().tileSize(),
@enjoylife
enjoylife / README.md
Created August 14, 2013 23:31 — forked from mbostock/.block

This example demonstrates the use of post-selection to customize an axis, even across transitions. After the axis is rendered, its elements (such as text labels, here) are reselected and modified to produce the desired appearance. When transitioning the axis, the post-selection modifies entering, updating and exiting elements. Passing null values to transition.tween cancels default tweens scheduled by the axis in favor of the customized styles.

@enjoylife
enjoylife / README.md
Created August 14, 2013 23:32 — forked from mbostock/.block

This variation of a line chart demonstrates a sequence of chained transitions. Clicking on the radio buttons changes the displayed metric. First, the line transitions to the new values. Then, the axes rescale to fit the new data.