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
[TestFixtureSetUp] | |
public void TestSetup() | |
{ | |
var routes = RouteTable.Routes; | |
routes.Clear(); | |
routes.MapRoute( | |
"Default", | |
"{controller}", | |
new {controller = "Recipe", action = "Healthy", id = ""} |
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
[Test] | |
public void should_map_to_recipe_controller() | |
{ | |
"~/Recipe".ShouldMapTo<recipecontroller>(action => action.Healthy()); | |
} |
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 class LoggingAspect : IInterceptor | |
{ | |
private readonly ILogger logger; | |
private readonly Stopwatch stopwatch; | |
public LoggingAspect(ILogger logger) | |
{ | |
this.logger = logger; | |
this.stopwatch = new Stopwatch(); | |
} |
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 class Person | |
{ | |
public int Id { get; set; } | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
} | |
public class PersonService | |
{ | |
public Person GetPerson(int id) |
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
<?php | |
function get_groups($user) { | |
// Active Directory server | |
$ldap_host = "ad.domain"; | |
// Active Directory DN, base path for our querying user | |
$ldap_dn = "CN=Users,DC=ad,DC=domain"; | |
// Active Directory user for querying | |
$query_user = "jane@".$ldap_host; |
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
private void BootAutoFac() | |
{ | |
var builder = new ContainerBuilder(); | |
var assemblies = AppDomain.CurrentDomain.GetAssemblies() | |
.Where(x => x.FullName.StartsWith("Your.Namespace")).ToArray(); | |
builder.RegisterAssemblyTypes(assemblies) | |
.Where(t => t.IsClass) |
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
SELECT t.name AS table_name, | |
SCHEMA_NAME(schema_id) AS schema_name, | |
c.name AS column_name | |
FROM sys.tables AS t | |
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID | |
WHERE c.name LIKE '%name of column%' | |
ORDER BY schema_name, table_name; |
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
/// <reference path="../MvcAngularJasmineTests/Scripts/angular.js"/> | |
/// <reference path="../MvcAngularJasmineTests/Scripts/angular-route.js"/> | |
/// <reference path="Scripts/angular-mocks.js"/> | |
/// <reference path="../MvcAngularJasmineTests/Scripts/app/app.js"/> | |
/// <reference path="../MvcAngularJasmineTests/Scripts/home/home.controller.js"/> | |
/// <reference path="Scripts/jasmine/jasmine.js"/> | |
describe('When working with the home.controller', function () { |
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 () { | |
'use strict'; | |
angular | |
.module('SampleApp') | |
.controller('HomeController', HomeController); | |
function HomeController() { | |
var vm = this; |
OlderNewer