Skip to content

Instantly share code, notes, and snippets.

@pthrasher
pthrasher / undulating burn out.glsl
Last active August 9, 2024 13: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 / README.md
Created December 10, 2012 23:07 — forked from mbostock/.block
Contour Plot
@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 = '';
function IsNumeric(e)
return Object.prototype.toString.call(e) == '[object Number]';
}
@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;
}
@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;
}