-
Webshims – HTML5 For The Masses
I’ve been researching the available shimming libaries out there that provide old browsers with modern features. The Webshims library does this in an efficient and unobtrusive way, always defering to the browser’s built in feature if it exists natively. With 2 lines of code you tell it where to find its shim scripts and then to…
-
Metaprogramming in Ruby and C#
First read this and understand metaprogramming in Ruby: http://www.devsource.com/c/a/Languages/An-Exercise-in-Metaprogramming-with-Ruby/ It seems that C# dynamic supports a similar scenario, but in a different way. C# dynamic objects are in fact not new Types created at runtime, but rather individual compiler-safe bags of key/value pairs that self expose the keys as properties. Thus C# dynamic objects are…
-
Loading Scripts As Strings into the DOM with JQuery
Here’s why JavaScript is teh awsome: var ns = {}; $(document).ready(function () { $(‘<scrip’+’t>ns.blah=function(){alert(“hi”);};</scr’+’ipt>’) .appendTo(‘body’); ns.blah(); }); With this I get: Here play with it yourself. http://www.jsfiddle.net/nVuNZ/ Consider the deployment and update scenarios enabled using this technique with a modular application pattern.
-
DataBinding JS Objects Into HTML Forms With jquery-datalink and jquery-tmpl
Till now chain.js has been my favorite light touch templating and data-linking library. Today finally the official JQuery templating, data-linking, and globalization plugins are here. The new plugins are very simple to use and nicely fill 2 very important gaps that really needed officially supported solutions, namely templating and datalinking. I’ll show you a little bit of the…
-
Gource Recipe For Win32
I think that a rendered historical view of a source controlled software project can be a key asset in understanding how a piece of software got to be what it is at any point in time. This seems to me to be a missing first class asset from our general tooling. Gource provides this as…
-
ColdFusion and onMissingMethod – Tapping The Hidden Power
Recently I had to do some work in ColdFusion. In the midst of the pain, imagine my surprise and delight to find that CF components support a dynamic dispatch construct. While unsightly, you can create wormholes and drop call routing through them It works like this. When you attempt a method call against a .cfc…
-
Fat-Free Templating with Barebones Javascript
Today I’m going to demonstrate a straight-forward and very effective technique for markup templating. I’ve borrowed the supplant prototype function from Douglas Crockford’s – And Then There Was Javascript presentation, in order to show you how to inject values from custom data structures directly into into strings. We’ll be doing a minimal implementation here in…
-
Implementing method_missing with C# dynamic – Part 2
In my previous post, Implementing method_missing with C# dynamic – Part 1, I demonstrated a simple approach to plugging a method_missing call routing seam into a DynamicObject. Here I’ll take it a step further to implement a generic method_missing function capable of passing any call to a forwarding context object. Note that I do not…
-
Implementing method_missing with C# dynamic – Part 1
One of the neat things about Ruby is its method_missing fallback capability. Using the C# 4.0 DynamicObject, we’re also able to control dispatch at runtime. I wanted to see how the method_missing idiom might work with a C# dynamic dispatcher, so I wrote up a small sample. [TestMethod] public void Can_Control_Dynamic_Dispatch() { dynamic dispatcher1…