Skip to content

Instantly share code, notes, and snippets.

View jrbalsano's full-sized avatar

Jonathan Balsano jrbalsano

View GitHub Profile
@jrbalsano
jrbalsano / index.html
Last active November 24, 2016 02:53
D3 Canvas Scatterplot - 3
<!doctype html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
const margin = { top: 20, right: 20, bottom: 40, left: 40 };
const height = 400 - margin.top - margin.bottom;
const width = 960 - margin.left - margin.right;
let colorToData = {};
let timer, startTime, selectedDatum;
@jrbalsano
jrbalsano / index.html
Last active November 24, 2016 03:19
D3 Canvas Scatterplot - 4
<!doctype html>
<html>
<head>
<style>
svg {
pointer-events: none;
}
</style>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
@jrbalsano
jrbalsano / index.html
Last active November 24, 2016 01:17
D3 Canvas Scatterplot - 2
<!doctype html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
const margin = { top: 20, right: 20, bottom: 40, left: 40 };
const height = 400 - margin.top - margin.bottom;
const width = 960 - margin.left - margin.right;
let timer, startTime;
@jrbalsano
jrbalsano / index.html
Last active November 24, 2016 00:41
D3 Canvas Scatterplot - 1
<!doctype html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
const height = 400;
const width = 960;
let timer, startTime;
function showTimeSince(startTime) {
@jrbalsano
jrbalsano / index.html
Last active May 23, 2016 00:11
D3 Scatterplot Rendering - 3
<!doctype html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var height = 500;
var width = 960;
var timer, startTime;
var startTime;
var BATCH_SIZE = 100;
@jrbalsano
jrbalsano / index.html
Created March 22, 2016 17:52
D3 Scatterplot Rendering - 2
<!doctype html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var height = 500;
var width = 960;
var timer, startTime;
var startTime;
@jrbalsano
jrbalsano / index.html
Created March 21, 2016 20:06
D3 Scatterplot Rendering - 1
<!doctype html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var height = 500;
var width = 960;
var timer, startTime;
var startTime;
@jrbalsano
jrbalsano / d3-scatter.js
Last active August 29, 2015 14:21
Graphing Spike
(function() {
$(document).ready(function() {
var d3data;
var dydata;
$('button.points').on('click', function() {
var i = 0;
var points = parseInt($('input.points').val(), 10);
var maxValue = 10000;
var curTime = new Date().getTime();
@jrbalsano
jrbalsano / commit-wrapper.sh
Last active August 29, 2015 13:56
Sh script to prepend bug description and append signed-off-by to a series of commits by a single author.
# Written by Jonathan Balsano <jrbalsano@gmail.com>
# Example usage: ./commit-wrapper.sh "Jonathan Balsano" "jrbalsano@gmail.com" master topic_branch "Bug 999 - Unwrapped Commits"
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] || [ -z "$5" ]; then
echo "usage: ./commit-wrapper.sh <author> <cla_email> <excl_oldest> <newest> <prepend_bug>"
exit 1
fi
export AUTHOR="$1"
export CLA_EMAIL="$2"
@jrbalsano
jrbalsano / tputlines.sh
Created May 28, 2013 17:54
An example of how to overwrite lines in the shell using a few different techniques. For further explanation: http://blog.jrbalsano.com/post/51571798768/overwriting-multiple-lines
#!/bin/sh
#Example 1 - Overwrite a line with a longer line
echo "This is a line\c"
sleep .5
echo "\rThis is another line, overwriting the last one."
#Example 2 - Overwrite a line with a shorter line
echo "This is a much longer line than the one we're about to write\c"
sleep .5