Skip to content

Instantly share code, notes, and snippets.

View micahcatlin's full-sized avatar

Micah Catlin micahcatlin

  • Google
  • San Francisco, CA
View GitHub Profile
looker.plugins.visualizations.add({
// Id and Label are legacy properties that no longer have any function besides documenting
// what the visualization used to have. The properties are now set via the manifest
// form within the admin/visualizations page of Looker
id: "hello_world",
label: "Hello World",
options: {
font_size: {
type: "string",
label: "Font Size",
@micahcatlin
micahcatlin / gist:5768206
Last active December 18, 2015 10:19
Coffeescript code block which produces different output on firefox and chrome
# http://jsfiddle.net/YwqsV/
fromAngleAxis = (angle, axis, dest) ->
axis = normalize axis
halfAngle = angle / 2
s = Math.sin halfAngle
dest[0] = axis[0] * s
dest[1] = axis[1] * s
dest[2] = axis[2] * s
dest[3] = Math.cos halfAngle
@micahcatlin
micahcatlin / gist:3961918
Created October 26, 2012 22:24
Fragment for generating collectable garbage
var makeSimulatedGameLoop = function(n) {
/* Pre-initialize an array with distinct simple objects */
var g = new Array(1000*n);
var count = 0;
for (i=0; i< g.length; i++) {
g[i] = {count: count++};
}
var _work = function() {
@micahcatlin
micahcatlin / gist:3961866
Created October 26, 2012 22:11
Fragment for measuring fps, heap size on Chrome
function() {
var lastHeapSize = null;
var lastFrameTime = null;
var runGame = function() {
requestAnimationFrame(runGame);
var frameTime = window.performance.now();
var heapSize = window.performance.memory.usedJSHeapSize;