This file contains 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
--> | |
POST /tasks/autofiller/101 | |
{ | |
object: { | |
id: 101, | |
description: 123, | |
building: 234, | |
site: 345, | |
reporter: 456 |
This file contains 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
pageModel.registerExceptionHandler("FeedbackNeeded", function (exception, ready) { | |
doStuff(exception); | |
doSomethingAsynchronousWithACallback(function(response){ | |
if (response.good) { | |
exception.handled = true; | |
} | |
ready(); // tell the exception broker we're ready to go on | |
}); | |
}); |
This file contains 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 string ZoneDataJSON | |
{ | |
get | |
{ | |
var newCount = 0L; | |
if (EntityInstance.IsNew()) return BlankZoneDataJSON; | |
var members = IoCContainer.Resolve<IZoneService>(). | |
GetImmediateZoneMembers(this.EntityId).ToList<IZoneMember>(). | |
Select(mem => new | |
{ |
This file contains 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
// Original: even without reading the code, it looked wrong. Lots of very | |
// obvious repetition. And switches are so often a code smell. | |
switch (modeName) { | |
case "Manual": | |
alert(self.options.messages.pleaseSet + self.options.messages.Manual); | |
break; | |
case "Automatic": | |
alert(self.options.messages.pleaseSet + self.options.messages.Automatic); | |
break; |
This file contains 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
-----BEGIN WEBFACTION INSTALL SCRIPT----- | |
#!/bin/env python2.7 | |
""" | |
Nginx 0.8.54 Installer New | |
"autostart": not applicable | |
"extra info": Enter domain name for the nginx app | |
""" |
This file contains 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
using System.Reflection; | |
private object ExecutePrivateMethod(string name, params object[] args) | |
{ | |
MethodInfo method = | |
GetType().BaseType.GetMethod(name, BindingFlags.NonPublic | BindingFlags.Instance); | |
if (method == null) | |
throw new NotImplementedException("Cannot find method " + name); | |
return method.Invoke(this, args); |
This file contains 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); | |
} | |
This file contains 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 (g) { | |
var v = [], | |
i=0, | |
j=g.jQuery, | |
d=g.$; | |
while (g.jQuery) { | |
v.push(g.jQuery.fn.jquery); | |
g.jQuery.noConflict(true); | |
i++ ; | |
} |
NewerOlder