This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup(method) | |
{ | |
window[method] = fake; | |
}; | |
var fake = function() | |
{ | |
return "faked"; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Minnow : App | |
{ | |
public Minnow(Context context) | |
: base(context) | |
{ | |
get("/", index); | |
} | |
private void index(Context context) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class when_retrieving_groups : BaseSpec | |
{ | |
[Fact] | |
public void can_retrieve_all_groups() | |
{ | |
Assert.NotEmpty(_groupsRepository.GetAll()); | |
} | |
[Fact] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = function(args, body) { | |
return Function(args, body); | |
}; | |
var alertFoo = f("foo","alert(foo)"); | |
alertFoo("bar"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++) | |
{ |