Skip to content

Instantly share code, notes, and snippets.

@trystan
trystan / ptfix.js
Last active October 21, 2015 22:46
Fix PivotalTracker
// Use this with the Custom Javascript For Websites
// plugin for Chrome to fix PivotalTracker
function fixIt(){
jQuery('h3[title="icebox"],label[class="icebox"]')
.attr("title","graveyard")
.children(1)
.text("Graveyard");
var horizon = jQuery('.story_name:contains("Event Horizon")')
@trystan
trystan / Color.as
Created February 23, 2013 21:42
RGB and HSV color in ActionScript
package
{
public class Color
{
public static function hsv(h:Number, s:Number, v:Number):uint
{
var r:Number, g:Number, b:Number, i:Number, f:Number, p:Number, q:Number, t:Number;
h %= 360;
if (v == 0)
return rgb(0, 0, 0);
@trystan
trystan / AStar.as
Created February 23, 2013 21:12
A Star algorithm
package
{
import flash.geom.Point;
public class AStar
{
private var open:Array = null;
private var closed:Array = null;
private var canEnter:Function;
@trystan
trystan / DijkstraGrid.as
Last active December 13, 2015 20:18
Dijkstra's algorithm using a grid for performance reasons.
// https://gist.github.com/trystan/4968958
package
{
import flash.geom.Point;
public class Dijkstra
{
private var grid:Array;
public function Dijkstra(w:int, h:int)
@trystan
trystan / Line.as
Last active December 12, 2015 03:08
Bresenham's line algorithm
// https://gist.github.com/4704144
package
{
import flash.geom.Point;
public class Line
{
public var points:Array = [];
public function Line(x0:int, y0:int, x1:int, y1:int) {