Skip to content

Instantly share code, notes, and snippets.

View pthrasher's full-sized avatar

Philip Thrasher pthrasher

View GitHub Profile
@pthrasher
pthrasher / a.js
Created January 31, 2012 02:55 — forked from tebriel/a.js
function formatJSONTime(jsonTime){
var matches = jsonTime.match(/date\((\d{13})\)/),
date = matches !== null ? formatTime(new Date(+matches[0])) : +new Date();
return date;
}
@pthrasher
pthrasher / formattime.js
Created January 31, 2012 03:20 — forked from tebriel/formattime.js
format time
function formatTime(e)
{
var _hour = e.getHours(),
_min = e.getMinutes(),
_ampm = +_hour >= 12 ? " PM" : " AM",
_nice_hour = ((+_hour % 12)+"").replace(/^0$/, "12");
return _nice_hour + ":" + _min + _ampm;
}
function IsNumeric(e)
return Object.prototype.toString.call(e) == '[object Number]';
}
@pthrasher
pthrasher / currency.js
Created January 31, 2012 03:35 — forked from tebriel/currency.js
currency!
function formatCurrency(amount)
{
var i = parseFloat(amount);
if (isNaN(i)) { i = 0.00; }
var minus = '';
if (i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + 0.005) * 100, 10);
i = i / 100;
s = '';
@pthrasher
pthrasher / README.md
Created December 10, 2012 23:07 — forked from mbostock/.block
Contour Plot
@pthrasher
pthrasher / undulating burn out.glsl
Last active August 29, 2015 14:11 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
#define M_PI 3.14159265358979323846 /* pi */
// General parameters
uniform sampler2D from;
uniform sampler2D to;
uniform float progress;
@pthrasher
pthrasher / crosshatch.glsl
Last active August 29, 2015 14:11 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
// General parameters
uniform sampler2D from;
uniform sampler2D to;
uniform float progress;
uniform vec2 resolution;
@pthrasher
pthrasher / TEMPLATE.glsl
Created December 23, 2014 20:31 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
float snoise(vec3 uv, float res) // by trisomie21
{
const vec3 s = vec3(1e0, 1e2, 1e4);
$(function() {
// good opportunity to combine into a single statement
// qq w cw <esc> A, <esc> 0 j q
var a = 10;
var b = 20;
var c = 30;
var d = 40;
var e = 50;
// opportunity to simplify syntax

Interesting part (unmounting & API) is at the end if you're not interested in the rest =).

Stress Tests

This animation proposal is just an attempt. In case it doesn't work out, I've gathered a few examples that can test the power of a future animation system.

  1. Parent is an infinitely spinning ball, and has a child ball that is also spinning. Clicking on the parent causes child to reverse spinning direction. This tests the ability of the animation system to compose animation, not in the sense of applying multiple interpolations to one or more variables passed onto the child (this should be trivial), but in the sense that the parent's constantly updating at the same time as the child, and has to ensure that it passes the animation commands correctly to it. This also tests that we can still intercept these animations (the clicking) and immediately change their configuration instead of queueing them.

  2. Typing letters and let them fly in concurrently. This tests concurrency, coordination of an array of ch