Skip to content

Instantly share code, notes, and snippets.

@balain
balain / data.json
Created December 29, 2020 21:01
Simple timeline - JSON -- for use with 'Simple timeline - HTML'
[
{ "id": 1, "content": "A", "start": "2020-06-20", "title": "This is a <B>title</B> for item A", "group": "group1" },
{ "id": 2, "content": "item 2", "start": "2020-04-14", "group": "group1" },
{ "id": 3, "content": "item 3", "start": "2020-04-18", "group": "group2" },
{ "id": 4, "content": "item 4", "start": "2020-04-16", "end": "2020-05-29", "className": "testA", "group": "group2" },
{ "id": 5, "content": "item 5", "start": "2020-05-25", "end": "2020-06-07", "group": "group3" },
{ "id": 6, "content": "item 6", "start": "2020-11-27", "type": "point", "group": "group1" },
{ "id": 7,
"content": "Background<BR>Item #<B>7</B>",
"start": "2020-12-01",
@balain
balain / remote.html
Created December 29, 2020 21:01
Simple timeline - HTML w/ remote JSON loading, 3 groups, one background, and min/max timespans
<!DOCTYPE HTML>
<html>
<head>
<title>Timeline w/ Remote Data</title>
<style type="text/css">
body, html {
font-family: sans-serif;
}
swagger: "2.0"
info:
description: "jira-status-reporter endpoings"
version: "1.0.0"
title: "JSR"
termsOfService: "https://github.com/jolewis-ddn/jira-status-reporter"
contact:
email: "tbd@tbd.com"
license:
name: "MIT"
[...Array(100).keys()].forEach((i) => {
try {
const startDate = new Date()
// Adjust here if you want to stage a different date
// startDate.setDate(startDate.getDate() + 3) // 3 days in the future
addBusinessDays(startDate, i, true)
} catch (err) {
console.error(err.message)
}
})
@balain
balain / renaming_to_main.md
Last active October 25, 2020 18:29
Renaming master branch to main on github

Keybase proof

I hereby claim:

  • I am balain on github.
  • I am balinjdl (https://keybase.io/balinjdl) on keybase.
  • I have a public key whose fingerprint is C902 B3B5 F031 39D9 C356 8585 F7AA 2C50 53A5 3F32

To claim this, I am signing this object:

@balain
balain / slopedata.csv
Created February 22, 2017 16:56
Example data file for slopegraph.js
Type Now Later
a 48 80
b 12 0
c 21 8
d 2 16
e 4 2
f 2 2
g 1 1
@balain
balain / slopegraph.html
Created February 22, 2017 16:29
Slopegraph w/ normal or log scale (uses slopegraph.js)
<!DOCTYPE html>
<html>
<head>
<title>Slopegraph</title>
<!-- <script language="javascript" type="text/javascript" src="./js/p5.min.js"></script> -->
<script language="javascript" type="text/javascript" src="./js/p5.js"></script>
<script language="javascript" type="text/javascript" src="./js/p5.dom.js"></script>
<script lang="javascript" type="text/javascript" src="./js/slopegraph.js"></script>
<script type="text/javascript">var slopegraph = new p5(slopegraph, 'slopegraph');</script>
</head>
@balain
balain / slopegraph.js
Last active February 13, 2021 01:16
Slopegraph w/ normal or log scale
/**
* slopegraph.js
* @author John D. Lewis
* @requires {@link p5.js}
* @requires {@link p5.dom.js}
* @file P5 script to create a slopegraph
*
* See also:
* - https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0003nk
* - http://charliepark.org/slopegraphs/