Skip to content

Instantly share code, notes, and snippets.

Tyler Larson talltyler

  • New York City
Block or report user

Report or block talltyler

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@talltyler
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
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
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
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 http://en.wikipedia.org/wiki/Kerning This code is basically from http://stackoverflow.com/a/15509006
View gist:5345894
(function(){
var _fillText,
__slice = [].slice;
_fillText = CanvasRenderingContext2D.prototype.fillText;
CanvasRenderingContext2D.prototype.fillText = function() {
var args, offset, previousLetter, str, x, y,
_this = this;
@talltyler
talltyler / gist:1671133
Created Jan 24, 2012
NYCoders Meeting Topics?
View gist:1671133
LiveCode
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
flex
OOP (states, events, organization and why)
frameworks (ActionScript,JavaScript)
@talltyler
talltyler / Main.as
Created Apr 28, 2011
ActionScript Spell Checking
View Main.as
package
{
import flash.display.Sprite;
import flash.events.Event;
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.events.Event;
// import flash.geom.PerspectiveProjection;
import flash.geom.Point;
import flash.geom.Rectangle;
You can’t perform that action at this time.