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 MailSender | |
{ | |
// Call this from Application_Start in Global.asax.cs | |
public static void Init() | |
{ | |
var viewRenderer = new EmailViewRenderer(ViewEngines.Engines) {EmailViewDirectoryName = "Emails"}; | |
var emailParser = new EmailParser(viewRenderer); | |
Email.CreateEmailService = ()=>new EmailService(viewRenderer, new PremailerEmailParser(emailParser), ()=>new SmtpClient()); | |
} | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>TypeScript AngularJS Controller Example</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" /> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script> | |
<script src="app.js"></script> |
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
/// <reference path="angular.d.ts"/> | |
class KittenController { | |
constructor( | |
private $scope: ng.IScope, | |
private debounce: IDebounce | |
) { | |
this.watchForSizeChanges(); | |
} |
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 () { | |
"use strict"; | |
var copyOwnProperties = function (from, to) { | |
for (var propertyName in from) { | |
if (from.hasOwnProperty(propertyName)) { | |
to[propertyName] = from[propertyName]; | |
} | |
} | |
}; |
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
// General resource format: | |
{ | |
metadata: [ // array of metadata objects | |
{ "<any-string1>": <any-json> }, | |
{ "<any-string2>": <any-json> }, | |
"<any-string3>" // short hand for { "<any-string3>": null }, | |
... | |
], | |
data: <any-javascript-value> // e.g. string, number, boolean, object, array |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Resource</title> | |
</head> | |
<body> | |
@TestHelper() | |
</body> | |
</html> |
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
> SemVerCompare.exe old\Cassette.dll new\Cassette.dll | |
Type added: Cassette.CassetteApplicationContainer | |
Type added: Cassette.ICassetteApplicationContainer`1 | |
Type changed: Cassette.IO.IsolatedStorageDirectory | |
Member added: Void .ctor(System.Func`1[System.IO.IsolatedStorage.IsolatedStorageFile]) | |
Type changed: Cassette.ICassetteApplication | |
Member added: System.Collections.Generic.IEnumerable`1[Cassette.Bundle] get_Bundles() | |
Member added: System.Collections.Generic.IEnumerable`1[Cassette.Bundle] Bundles | |
Type changed: Cassette.IO.IsolatedStorageFile |
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 Global : System.Web.HttpApplication { | |
protected void Application_Start(object sender, EventArgs e) { | |
var store = new SmartMessageStore(); | |
DependencyResolver.Register(typeof(IMessageStore), () => store); | |
} | |
} |
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
// Sorry to stir things up, but I really don't get on with the current *Unit test frameworks | |
// in C#. I hate creating_long_semi_english method names. I hate then repeating myself | |
// in code e.g. public void It_sould_equal_10() { Assert.That(it == 10); } | |
// I think the problem stems from making a method the atom of a test. | |
// This leads to crap method names and hard to understand tests. | |
// What follows is a different approach. (Not real code yet, just ideas!) | |
// One Test class per class under test. | |
// Inherits framework `Tests` class to provide test-DSL methods. |
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
Given loadPage('/login'), [ | |
Given userIsRemembered('johnsmith'), [ | |
When [ | |
'enter correct password': input(password: 'test') | |
click 'login' | |
] | |
Then [ | |
dashboardScreenLoaded() | |
] | |
] |
NewerOlder