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++ ; | |
} |
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
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
-----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
// 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
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
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
--> | |
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
n3dst4@lesster2:~/438231 (master) $ date; w | |
Sun Mar 17 17:05:27 EDT 2013 | |
17:09:52 up 4:18, 0 users, load average: 139.84, 120.85, 91.34 | |
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT |
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
<!-- | |
It's all about "forcing" with MS stuff. *Force* IIS to serve a header which will | |
*force* IE not to use it's shitty compatibility mode, even if it's an intranet | |
site and the client has "display intranet sites in compatibility view" ticked in | |
their compatibility prefs. | |
The alternative is to include the equivalent <meta http-equiv...> in your | |
markup, but that will sometimes be ignored. | |
This header is discouraged by MS for production environments. Then again, MS is |
OlderNewer