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
IUnityContainer container = new UnityContainer(); | |
container.RegisterType(typeof(IRepository<>), typeof(EfRepository<>)); |
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
@echo off | |
set COMPLUS_ZapDisable=1 | |
cd /d "%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\ide\" | |
echo. | |
echo Be sure to uncheck "Enable the Visual Studio Hosting Process" in Project Properties. | |
echo. | |
pause |
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
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
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
namespace Samples | |
{ | |
using System; | |
using System.Collections.Generic; | |
public class CustomEnumerableDemoConsole | |
{ | |
public static void Main(params string[] args) | |
{ | |
CustomEnumerable enumerable = new CustomEnumerable("One", "Two", "Three"); |
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
namespace GenericInterfacesWithUnity | |
{ | |
using Microsoft.Practices.Unity; | |
using NUnit.Framework; | |
[TestFixture] | |
public class UnityWithRegularInterfaceTests | |
{ | |
private UnityContainer container; |
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
namespace OptionalParametersOnInterface | |
{ | |
using System; | |
public interface IFoo | |
{ | |
void DoStuff(bool someBit = true); | |
} | |
public class Foo : IFoo |
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
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g, ''); | |
}; |
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
// sample application-en.json file | |
/* | |
{ | |
Title : "Welcome to {CurrentSite}" | |
} | |
*/ | |
if (typeof String.prototype.supplant === 'undefined') { | |
String.prototype.supplant = function (o, defaultIfMissing) { | |
return this.replace(/{([^{}]*)}/g, |
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
<!-- http://stackoverflow.com/questions/9261296/any-good-techniques-to-debug-template-binding-faults-for-knockout-js --> | |
<pre data-bind="text: JSON.stringify(ko.toJS($data), null, 2)"></pre> |
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( $ ) { | |
$.fn.readOnlySuffix = function(suffix) { | |
return this.each(function() { | |
var $this = $(this), | |
suffixLength = suffix.length, | |
oldValue = suffix, | |
mouseIsDown = false; | |
// Must be a text input or text area | |
if (!($this.is(":text") || $this.tagName.toLowerCase() == "textarea")){ |
OlderNewer