Skip to content

Instantly share code, notes, and snippets.

View dribnet's full-sized avatar

tom white dribnet

View GitHub Profile
@dribnet
dribnet / README.md
Last active December 14, 2015 04:19 — forked from mbostock/.block
strokes - General Update Pattern, II

strokes fork and port of mike's general update pattern tutorial, II.

merge requests should go to the example in the repo


By adding a key to the data-join, letters that are already displayed are put in the update selection. Now updates can occur anywhere in the array, depending on the overlap between the old letters and the new letters. The text content only needs updating on enter because the mapping from letter to element never changes; however, the x-position of the text element must now be recomputed on update as well as enter.

It'll be easier to see what's going on when we add animated transitions next!

@dribnet
dribnet / README.md
Last active December 14, 2015 04:19 — forked from mbostock/.block
strokes - General Update Pattern, III

strokes fork and port of mike's general update pattern tutorial, III.

merge requests should go to the example in the repo


By adding transitions, we can more easily follow the elements as they are entered, updated and exited. Separate transitions are defined for each of the three states.

Note that no transition is applied to the merged enter + update selection; this is because it would supersede the transition already scheduled on entering and updating elements. It's possible to schedule concurrent elements by using transition.transition or by setting transition.id, but it's simpler here to only transition the x-position on update; for entering elements, the x-position is assigned statically.

@dribnet
dribnet / README.md
Last active December 15, 2015 04:39 — forked from lennyjpg/_.md
lennyjpg's Hi

A fork of @lennyjpg's tributary inlet only lightly adapted for s.trokes.org.

(ns d3-layout-example
(:require [strokes :refer [d3]]))
(strokes/bootstrap)
(def width 960)
(def height 500)
(defn dprint [x]
(.log js/console (pr-str x)))
@dribnet
dribnet / py_cudart_memory.py
Created January 18, 2016 17:35 — forked from udibr/py_cudart_memory.py
Get memory usage of CUDA GPU, using ctypes and libcudart
import ctypes
# Path to location of libcudart
_CUDA = "/usr/local/cuda/lib/libcudart.dylib"
cuda = ctypes.cdll.LoadLibrary(_CUDA)
cuda.cudaMemGetInfo.restype = int
cuda.cudaMemGetInfo.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
cuda.cudaGetErrorString.restype = ctypes.c_char_p
@dribnet
dribnet / .DS_Store
Last active October 23, 2019 21:37
Marble Bot
@dribnet
dribnet / .block
Last active October 19, 2016 13:04 — forked from carlgordon64/.block
Online Chatbox
license: mit
@dribnet
dribnet / .block
Last active November 2, 2016 01:38 — forked from prestojack/.block
PS1 MDDN 342 2016
license: mit
@dribnet
dribnet / README.md
Last active November 2, 2016 02:02 — forked from AndrewMoffat/README.md
MDDN 342 Final Project

Face Generator - Andrew Moffat This is the refined version of my face generator. To begin with, the original version of the project featured a monochromatic sketch style, using Bezier curves. I wanted to revisit this project as I felt that I had a really solid base of code and graphic design to build upon, where I had left the project it was almost as if I had drawn the outline, but had forgotten to colour it in. I identified that one part of the project, to produce unique faces was being held back by the stylistic similarity, the lack of distinct visual elements.

I initially began by changing each face element into its own object, and created the grid using an array of objects. My intent was to utilise this for animation, but unfortunately this did not work out. I then enlarged the faces to allow for quicker comparisons, and increased the saturation on the faces to a more natural skin tone. I also refined the mouth down to enhance the visibility of emotion, and enlarged the eyes, as well as adding in va

@dribnet
dribnet / .block
Last active October 18, 2018 21:03 — forked from prestojack/.block
PAPER: Parametric Alphabet
license: mit