Skip to content

Instantly share code, notes, and snippets.

View stepheneb's full-sized avatar

Stephen Bannasch stepheneb

View GitHub Profile
@stepheneb
stepheneb / gist:a53d69456f1b8d9751644452647ac8e5
Created September 7, 2021 02:46
building electron-forge with bolt
[electron-forge ruby-2.7.3 (master)]$ git pull
Already up to date.
[electron-forge ruby-2.7.3 (master)]$ bolt
⚡️ bolt v0.24.9 (node v14.17.4)
🔎 [1/4] Validating project...
📦 [2/4] Installing project dependencies...
yarn install v1.22.11
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
[3/5] 🚚 Fetching packages...
@stepheneb
stepheneb / index.html
Last active May 28, 2021 14:48
Trivially Simple Beam using D3.js
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Simple Beam</title>
<script type="text/javascript" src="https://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="https://d3js.org/d3-geo.v2.js"></script>
<style type="text/css">
@stepheneb
stepheneb / README.md
Last active May 28, 2021 14:39
SVG path benchmark (2012)

SVG Path Benchmark

Note: January 7, 2020

This benchmark was written in 2012 and the performance measurements below are valid for browsers at that time. The attribute path_seglist has been removed from the SCG element on Chrome and Firefox and this older benchmark no long runs on those systems.

The benchmark does still run on Safari and now has performance equivalent to the Canvas benchmark.

This example benchmarks the time taken to draw an SVG path with 10000 line segments.

@stepheneb
stepheneb / .block
Created February 18, 2020 18:25 — forked from mbostock/.block
Pan & Zoom Axes
license: gpl-3.0
@stepheneb
stepheneb / index.html
Last active January 14, 2020 16:50 — forked from justincormack/index.html
HSL colors in D3.js v2
<html>
<head>
<title>HSL Hues</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
</head>
<body>
<p>HSL Hues: 0 .. 360 </p>
<svg id="hsl-hue1"></svg>
<p>HSL Hues: 0 .. 256 </p>
<svg id="hsl-hue2"></svg>
@stepheneb
stepheneb / d3.js
Last active January 14, 2020 16:44
D3 Example: Global Surface Temperature: 500 ... 2009
(function(){if (!Date.now) Date.now = function() {
return +new Date;
};
try {
document.createElement("div").style.setProperty("opacity", 0, "");
} catch (error) {
var d3_style_prototype = CSSStyleDeclaration.prototype,
d3_style_setProperty = d3_style_prototype.setProperty;
d3_style_prototype.setProperty = function(name, value, priority) {
d3_style_setProperty.call(this, name, value + "", priority);
@stepheneb
stepheneb / index.html
Last active January 14, 2020 16:28
Lennard-Jones Potential in Interactive Graph
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Simple Beam</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
body {
font: 13px sans-serif;
}
@stepheneb
stepheneb / index.html
Last active January 14, 2020 16:25
D3 Example: zoom, pan, and axis rescale
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Two Graphs</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<script type="text/javascript" src="simple-graph.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: #fff; }
@stepheneb
stepheneb / README.md
Last active January 8, 2020 05:34
JavaScript mixin patterns

JavaScript mixin patterns

Four different ways JavaScript variables and closures can be used to implement different mix-in patterns.

Each implementation creates a mixin that creates property getter functions for model objects.

By model object I mean a function that takes properties (keys and values)( and returns an object that:

@stepheneb
stepheneb / README.md
Last active January 8, 2020 05:07
AgentScript Climate model (Java applet).