Skip to content

Instantly share code, notes, and snippets.

@jbosse
jbosse / ,loader
Created February 28, 2013 16:46
dynamic load js
<script>
(function (undefined) {
try {
if (jQuery !== undefined) {
return;
}
} catch (e) {
var body = document.getElementsByTagName('body')[0];
var jqueryScript = document.createElement("script");
@jbosse
jbosse / blank.sln
Created January 11, 2013 18:11
blank solution
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@jbosse
jbosse / ninjecthack.cs
Created April 12, 2012 00:11
Hack around Ninject 2 => 3 api change
using System.Linq;
using Hudoo.Web.App_Start;
namespace Hudoo.Web.Test.DeleporterHelpers
{
public static class NinjectControllerFactoryUtils
{
public static void TemporarilyReplaceBinding<TService>(TService implementation)
{
// get a handle on the Ninject Kernel (how you do this will depend on how you setup the Kernel)
@jbosse
jbosse / ControlExtensions.cs
Created December 16, 2010 19:28
ControlExtensions.cs
public static class ControlExtensions
{
public static T Find<T>(this Control control, string id) where T : Control
{
return (T) control.FindControl(id);
}
}
@jbosse
jbosse / UnitTestsPresenter.cs
Created November 29, 2010 16:45
UnitTestsPresenter
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Website.App_Code.UnitTests
{
public class TestResult
{
public string Test { get; set; }
dfwffwer
agrreagrgegerg
[Test]
public virtual void ShouldAllReturnHello()
{
AssertAll
(
() => Assert.AreEqual("Hello", "World"),
() => Assert.AreEqual("Hello", "Kevin"),
() => Assert.AreEqual("Hello", "Jimmy"),
() => Assert.AreEqual("Hello", "Hello")
);