Skip to content

Instantly share code, notes, and snippets.

Kerry Rodden kerryrodden

View GitHub Profile
@kerryrodden
kerryrodden / README.md
Created Feb 10, 2019
p5.js sketch that uses clmtrackr to capture eye position and draw trails representing that over time
View README.md

p5.js sketch that finds eye positions from the webcam and draws a representation of their movement, with random colors for the irises.

Click on the canvas to save an image; press a key to clear the canvas.

This sketch was very helpful in getting started with clmtrackr 🙏

View README.md

What this code does and why

This code makes a "poem" via choosing lines at random from a book of phrases - in particular, it uses "Fifteen Thousand Useful Phrases" by Grenville Kleiser, which it downloads from Project Gutenberg.

Inspired by other computer-generated short texts, like Allison Parrish's Twitter bots, I was curious whether I could generate some poetry that seemed vaguely plausible, purely by using a random approach - without having to do any natural language processing or machine learning. To do that I needed a text to choose lines from, where the individual lines were already readable English, and would have a reasonable chance of making some sense when rearranged at random.

Interesting outputs

Here are a few example outputs that I thought could pass as human-written poetry (not necessarily good poetry):

@kerryrodden
kerryrodden / index.html
Last active Oct 25, 2019
Basic Tic-Tac-Toe in SVG
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Tic Tac Toe</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
</head>
@kerryrodden
kerryrodden / .block
Last active Feb 20, 2019
Dynamic labeling over time
View .block
license: mit
View .block
license: apache-2.0
@kerryrodden
kerryrodden / .block
Last active Jul 10, 2020
Sequences sunburst (d3 v4)
View .block
license: apache-2.0
@kerryrodden
kerryrodden / .block
Last active Oct 4, 2016
Sequences sunburst: unconf badge
View .block
license: apache-2.0
@kerryrodden
kerryrodden / LICENSE
Last active Aug 26, 2016
Sequences icicle
View LICENSE
Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@kerryrodden
kerryrodden / README.md
Last active Apr 27, 2020
Zoomable sunburst with updating data
View README.md

I combined Mike Bostock's Zoomable Sunburst and Sunburst Partition examples, so that I could have both zooming and updating the underlying data (between count and size, in this case). A simple combination of the examples does not work; you have to edit the arcTween function used for updating the data, so that when it redraws the partition layout, it takes account of the current zoom level by adjusting the domain of the x scale.

Click on any arc to zoom in, and click on the center circle to zoom out. Use the Size/Count radio buttons to update the data.

@kerryrodden
kerryrodden / .block
Last active May 19, 2020
Sequences sunburst
View .block
license: apache-2.0
You can’t perform that action at this time.