Skip to content

Instantly share code, notes, and snippets.

// I'm implementing a reusable library for the Scheduler-Agent-Supervisor pattern blogged about by Clemens Vaster's here:
// http://vasters.com/clemensv/2010/09/28/Cloud+Architecture+The+SchedulerAgentSupervisor+Pattern.aspx
// I'm starting my work on the communication between the Scheduler and the Agent's. This will be (for now) done via
// WCF and leverage MSMQ for elasticity. The Scheduler has a request queue and a response queue. This is the first
// draft of the Scheduler class which implements both queue WCF endpoints as well as some helper functions for client creation.
// Because of Task<T> this helps facilitate the DataContractResolver away from the user of the library.
using System;
using System.Messaging;
@skoon
skoon / aspHide
Created October 15, 2010 00:17 — forked from buzzedword/gist:627318
jQuery.fn.aspHide = function() {
$(this).each(function() {
var elem = $(this);
elem.data('height', elem.height());
elem.height('0');
elem.css('visibility', 'hidden');
});
};
jQuery.fn.aspShow = function() {
@skoon
skoon / gist:590069
Created September 21, 2010 17:18 — forked from karlseguin/gist:590059
function setup(method)
{
window[method] = fake;
};
var fake = function()
{
return "faked";
};
@skoon
skoon / screening.js
Created September 13, 2010 20:29 — forked from rmurphey/screening.js
// 1: how could you rewrite the following to make it shorter?
/*if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}*/
(foo) ? bar.doSomething(el) : bar.doSomethingElse(el);
public class App
{
private Context _context = null;
private List<IHandler> _getHandlers = null;
private List<IHandler> _postHandlers = null;
private List<IHandler> _putHandlers = null;
private List<IHandler> _deleteHandlers = null;
public class Minnow : App
{
public Minnow(Context context)
: base(context)
{
get("/", index);
}
private void index(Context context)
{
public class when_retrieving_groups : BaseSpec
{
[Fact]
public void can_retrieve_all_groups()
{
Assert.NotEmpty(_groupsRepository.GetAll());
}
[Fact]
var f = function(args, body) {
return Function(args, body);
};
var alertFoo = f("foo","alert(foo)");
alertFoo("bar");
<!-- All the "runat=server" tags are so the markup can be used by DotNetNuke. I don't know if that contributed to the problem or not. It didn't appear to. -->
<div class="maincontent">
<table class="maintable">
<tr>
<td id="leftTallContent" runat="server">
</td>
<td id="middleContent">
<div id="doc3" class="yui-t7">
<div id="bd">
<div class="yui-gb">
var url = $(e.target).attr("href");
if (url !== null && url != "" && url !== "undefined")
{
var params = (function() {
var qs = url.split("?");
var p = qs[1].split("&");
var params = {};
var l = p.length;
for(var c=0;c<l;c++)
{