Skip to content

Instantly share code, notes, and snippets.


Tyler Larson talltyler

  • New York City
View GitHub Profile
talltyler / parseFnt.js
Created Sep 17, 2018
FNT AngleCode font parser
View parseFnt.js
const lines = data.split('\n');
function parseObject(args) {
const result = {};
for(let i=0;i<args.length;i++){
const arg = args[i].split('=');
const val = arg[1];
result[arg[0]] = ~val.indexOf('"') ? val.substr(1,val.length-2) : parseFloat(val,10);
return result;
View gist:46a0de8fc8825c771bec526b715d4704
let http = require("http"),
raspivid = require('raspivid');
http.createServer(function (req, res) {
if (req.url != "/movie.mp4") {
res.writeHead(200, { "Content-Type": "text/html" });
res.end('<video src="http://localhost:8888/movie.mp4"></video>');
} else {
res.writeHead(200, {
"Content-Type": "video/mp4"
talltyler / gist:5346400
Last active Dec 16, 2015
The HTML Canvas element is a work in progress that isn't really ready in many cases. I've started a running list of the busted things that I have found so far with links to more information about them and fixes if I have them.
View gist:5346400
talltyler / gist:5345959
Last active Dec 16, 2015
In most browsers the ctx.measureText() method returns an object with only a width property on it. actualBoundingBoxAscent & actualBoundingBoxDescent are in the spec but not implemented yet by any browser. because of this only fonts of normal proportions will have correct height values, things like condensed fonts will be off. We measure the widt…
View gist:5345959
var measureText = function (ctx,font,text) {
ctx.font = font;
var width = ctx.measureText(text).width;
var metrics = ctx.measureText('M');
return {width:width, height: metrics.width + (metrics.actualBoundingBoxAscent||0) + (metrics.actualBoundingBoxDescent||0)};
talltyler / gist:5345894
Created Apr 9, 2013
This code gives the HTML canvas element JavaScript support for letter spacing. Don't confuse letter spacing with kerning This code is basically from
View gist:5345894
var _fillText,
__slice = [].slice;
_fillText = CanvasRenderingContext2D.prototype.fillText;
CanvasRenderingContext2D.prototype.fillText = function() {
var args, offset, previousLetter, str, x, y,
_this = this;
talltyler / gist:1671133
Created Jan 24, 2012
NYCoders Meeting Topics?
View gist:1671133
Unity3d publishing to flash
Liquid Flexible layouts and different screen sizes
Drawing in Flash
jQuery & jQuery.animation
Dreamweaver (what's new, are people using it?)
iOS flex & air
OOP (states, events, organization and why)
frameworks (ActionScript,JavaScript)
talltyler /
Created Apr 28, 2011
ActionScript Spell Checking
import flash.display.Sprite;
import flash.text.TextField;
public class Main extends Sprite
public function Main():void
View gist:706672
package com.paperlesspost.components.coverflow
import com.paperlesspost.components.coverflow.renderers.IItemRenderer;
import flash.display.DisplayObject;
import flash.display.Sprite;
// import flash.geom.PerspectiveProjection;
import flash.geom.Point;
import flash.geom.Rectangle;
You can’t perform that action at this time.