Skip to content

Instantly share code, notes, and snippets.

@vlandham
vlandham / index.html
Last active August 27, 2015 16:31 — forked from tafsiri/index.html
2D Picking with canvas
<html lang="en">
<head>
<meta charset="utf-8">
<title>2D Picking with canvas</title>
<meta name="description" content="">
<meta name="author" content="Yannick Assogba">
<script src="//rawgit.com/mrdoob/stats.js/master/build/stats.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5/dat.gui.js"></script>

A short code excerpt from this visualization I created for the longform article “Iouri Podladtchikov – You only fly once” by the Neue Zürcher Zeitung.

It's a very simple way to create an interactive animation based on video material. Hover over the image to go through the animation.

I used Final Cut Pro to export the frames of a short video sequence, which I then stitched together into a single film strip using ImageMagick: convert folder-of-stills/* +append filmstrip.jpg

Year Winner Country Joint? % of prize Institution or individual? ISO country code (WHERE APP) Sex Notes
1901 Jean Henri Dunant Switzerland Yes 50 Ind. CH M Founder of the International Committee of the Red Cross, Geneva; Initiator of the Geneva Convention and founder and President of the first French peace society (since 1889 it has been called the Société Francaise pour l'arbitrage entre nations).
1901 Frédéric Passy France Yes 50 Ind. FR M Founder of the International Committee of the Red Cross, Geneva; Initiator of the Geneva Convention and founder and President of the first French peace society (since 1889 it has been called the Société Francaise pour l'arbitrage entre nations).
1902 Élie Ducommun Switzerland Yes 50 Ind. CH M Honorary Secretary of the Permanent International Peace Bureau, Berne
1902 Charles Albert Gobat Switzerland Yes 50 Ind. CH M Secretary General of the Inter-Parliamentary Union, Berne
1903 Sir William Randal Cremer UK No 100 Ind. GB M Member of the British Parliament. Secretar
#!/bin/bash
MOVIE=$1
ffmpeg -i $MOVIE -r 10 -vcodec png out-static-%05d.png
convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $MOVIE.gif
rm out-static*.png
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>[]</title>
<style type="text/css">
.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;}
.clearfix:after{clear:both;}
.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
@vlandham
vlandham / 0_reuse_code.js
Created June 2, 2014 13:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vlandham
vlandham / gist:fc91ee2170af1fe759f8
Created June 7, 2014 04:16 — forked from anonymous/gist:831fdfa042057b85ebf0
processing for animated gif
void setup() {
size(500, 500);
smooth(8);
noStroke();
}
float t, tt, ht, x, y;
int N = 11;
float l = 24;
float sp = l*1.5;
@vlandham
vlandham / index.js
Last active August 29, 2015 14:10
Gist from mistakes.io
// --------
// types
// --------
// falsy values
function is_false(value) { return !(value); };
is_false(false);
is_false(undefined);
is_false(undefined);
@vlandham
vlandham / old_roads.css
Last active August 29, 2015 14:12
Streets only styling for Mapbox Studio
[class='motorway'] {
line-join:round;
line-color: @motorway_case;
#road { line-cap: round; }
#tunnel { line-dasharray:3,2; }
[zoom>=6] { line-width:0.4; }
[zoom>=7] { line-width:0.6; }
[zoom>=8] { line-width:1.5; }
[zoom>=9] { line-width: 1.75; }
[zoom>=10] { line-width:2; }
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.