Skip to content

Instantly share code, notes, and snippets.

View ifandelse's full-sized avatar

Jim Cowart ifandelse

View GitHub Profile
@ifandelse
ifandelse / trafficCop.js
Created November 25, 2011 06:50
Traffic Cop Source
/*
TrafficCop
Author: Jim Cowart
License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license)
Version 0.1.0
*/
(function($, undefined) {
var inProgress = {};
@ifandelse
ifandelse / eagerload.js
Created August 15, 2011 14:26
How to use the Knockout.js-External-Template-Engine to Eager Load Templates
var tmplEagerLoad = [ "customer", "user", "search", "about", "orders" ];
// This will cause the templates to be requested and cached locally
// in script blocks for KO to pick up like any normal embedded template
tmpl.EagerLoad.forEach(function(template) {
ko.externaljQueryTemplateEngine.getTemplateNode(template);
});
@ifandelse
ifandelse / FileCombiner.cs
Created July 29, 2011 21:26
Playing with C# 'event loop' approach to demonstrate against nodejs example of same functionality
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace FileCombiner
{
class Program
@ifandelse
ifandelse / MementoGist.cs
Created May 6, 2011 02:10
Trying to work out a way for a Memento Reset's behavior to be unknown/transparent to target domain model
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace ResetIdeas
{
class Program
@ifandelse
ifandelse / IE_Sucks.html
Created April 28, 2011 03:59
Testing Script Element Insertion with jQuery and IE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<script type="text/javascript" src="js/jquery-1.5.2.js"></script>
<script type="text/javascript">
$(function(){