Skip to content
View gist:1271824
var imageRegex = /\.(png|jpg|jpeg|gif)$/;
str= str.replace(/(\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|])/gim,
function(str) {
if (str.match(imageRegex)) {
return('img src=' + str + 'end img src');
} else {
return('<b>[</b><a href="' + str + '" class="autolink" target="_blank">' + str.replace('http://','') + '</a><b>]</b>');
View gist:1132219
class MonsterGraphic extends Graphic {
public var creatureSprite:Spritemap;
public var armorSprite:Spritemap;
public var weaponSprite:Spritemap;
override public function render(target:BitmapData, point:Point, camera:Point):void {
creatureSprite.render(target, point, camera);
armorSprite.render(target, point, camera);
weaponSprite.render(target, point, camera);
View gist:1103535
var path:Array = new Array();
var openList:Array = new Array();
var closedList:Array = new Array();
var closedListD:Dictionary = new Dictionary();
var neighborList:Vector.<Node>;
trace("path from: " + this.x + "-" + this.y + " to " + endNode.x + "-" + endNode.y);
var currentNode:Node = this;

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
// Create cave of size 200x100 tiles
var cave:FlxCaveGenerator = new FlxCaveGenerator(200, 100);
// Generate the level and returns a matrix
// 0 = empty, 1 = wall tile
var caveMatrix:Array = cave.generateCaveLevel();
// Converts the matrix into a string that is readable by FlxTileMap
var dataStr:String = FlxCaveGenerator.convertMatrixToStr( caveMatrix );
* This class uses the cellular automata algorithm
* to generate very sexy caves.
* (Coded by Eddie Lee, October 16, 2010)
public class FlxCaveGenerator
private var _numTilesCols:uint = 10;
Something went wrong with that request. Please try again.