Code

I’ve written a lot of code over the years. Some of it is good.

Here are my GitHub details:

Here are more details on the significant stuff.

Denina

Class Library and Episerver Add-On
C#
Project Website

This is the library I have the most work into. Denina is a scripting engine meant to be embedded into a CMS. It’s gotten some usage in the Episerver community, and more in the Umbraco community.

Episerver Markup

Episerver Add-On
C#
GitHub Repository

This is a library to make working with static HTML easier in Episerver. It provides three things:

  1. A block type to embed HTML
  2. A media type to extract fragments of markup from uploaded HTML files
  3. A media type to combine all the resources needed for a fully self-contained client app into a single deployable “app file” that editors can simply drag onto the page (here’s a video of this)

For each method, a framework is provided to bootstrap all associated resources (JS and CSS; on-site or remote) and inject them into the page. For options #2 and #3 above, front-end developers could work on code locally, then simply drag it into an Episerver site and let editors easily inject all the necessary resources into a page.

The result is, hopefully, a toolkit to make front-end developers very happy when working with Episerver, and something that provides the ability to blur the line between managed content and static HTML in a responsible, manageable, repeatable way.

URL Stemmer

Class Library
C#
GitHub Repository

When working with URL redirection, I got interested in the concept of URL equality. How do you determine if two URLs are equal?

The real “value” of a URL is the resource it responds with. And two URLs can respond with the same resource while differing in:

This library will normalize a URL in several configurable ways, allowing you to compare them to test for equality, or store them in a more standard form.

Poor Man's Code Editor

JavaScript Fragment
HTML / JS/ CSS
GitHub Gist

This is an example of using a textarea as a code editor without any external dependencies or files. It’s a bunch of inline JavaScript and CSS on a textarea element that:

  1. Sort of styles it like a code editor
  2. Catches tabs and converts them to four (4) spaces
  3. Duplicates leading spaces from the last line
  4. Auto-expands to input

It’s not sophisticated, but if you need a code-ish editor in a place where you can’t or don’t want to pull in anything more complicated, it’s handy.

Airtable ORM

Class Library
C#
GitHub Gist

This is a C# class that will retrieve a bunch of records from Airtable and convert them to POCOs. It reflects the class definition and applies Airtable data based on designated attributes. It has an event model that allows you to modify the data prior to object population, and respond to conversion failures.

While designed for Airtable, it’s a handy reference for a lot of problems you’d find when auto-populating any data in C#. There are a lot of patterns in here that are applicable to anything (swap Airtable out for any other data resouce...)

I sent this to Airtable, and they tweeted it from their account at one point. I use it on this site, to retrieve data for The Interesting List.

Nemmet

Class Library
C#
GitHub

This was an afternoon project that I did for a challenge and had mixed results with. It’s a C# implementation of Emmet, the HTML code expansion tool that’s built into some code editors.

I wanted something that would run inside the context of C#. The README shows what I implemented.

I put 3-4 hours into this, but it might be handy for some applications. I think I did this for some Denina implementation. I keep meaning to come back to it.