JavaScript Canvas.DrawWindow implementation

I have implemented DrawWindow (HTML rendering) functionality in Canvas. It is essentially rendering HTML inside of the canvas tag without modifying the original DOM. This took a lot of trial and error, but it is working pretty well now. The code is online here: https://github.com/bgrins/DrawWindow, and a really minimal project page is here: DrawWindow demo.

Read more →

bindWithDelay jQuery Plugin - Now With Throttling

I decided to add in throttling functionality to the jquery bindWithDelay plugin. This is a nice feature that didn't require very many changes to the code (see the: diff).

Read more →

wordsolver.js

I was playing around with unscrambling words recently, and decided to implement a solver in JavaScript. I called it wordsolver.js.

Read more →

Safer JSONP

I read a nice write up on on JSON and JSONP by Angus Croll. He provided a sample implementation of a safe JSONP library.

Read more →

filereader.js - A Lightweight FileReader Wrapper

I am working on project that needs to read local files. This relies on the FileReader interface, and I couldn't find any JavaScript libraries to help out with common usage for this, so I made one.

Read more →

A* Search Algorithm in JavaScript (Updated)

Get all the updated source code from github.

Read more →

bindWithDelay jQuery Plugin

Sometimes, I want to have a JavaScript event that doesn't fire until the native event stops firing for a short timeout. I've needed to use that pattern in almost every project I have worked on.

Read more →

Make Table Rows Sortable Using jQuery UI Sortable

I wrote an article, Make Table Rows Sortable Using jQuery UI Sortable on the Foliotek Development Blog about a problem that I ran into when trying to set up a basic sortable table using jQuery UI. The columns would collapse down once the dragging began.

Read more →

C# Tips - Type Conversion with "as" and "is"

I had used C# for at least a year before I found out a couple of nice shorthand ways to convert types. These are the is and as expressions, and using them can help make your code more readable.

Read more →

Keep Original Variable State Between Event Binding and Execution

I wrote an article on the Foliotek Development Blog about saving the state of a variable inside a closure that is not executed immediately. For example, functions passed into event binding or setTimeout(). Here is a quick rundown of the problem and the solution (using the jQuery library).

Read more →