<#@ template debug=”false” hostspecific=”true” language=”C#” #> <#@ assembly name=”System.Core” #> <#@ assembly name=”System.Configuration” #> <#@ import namespace=”System.Linq” #> <#@ import namespace=”System.Text” #> <#@ import namespace=”System.Collections.Generic” #> <#@ import namespace=”System.Configuration” #> <#@ output extension=”.tt.cs” #> <# var projectPath = Host.ResolveAssemblyReference(“$(ProjectDir)”); var configFile = projectPath + “App.config”; var map = new ExeConfigurationFileMap() { ExeConfigFilename = configFile }; Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);… Read more →
Category: code
Beware Package Managers
It’s evident that package managers such as npm and nuget are an effective way for hackers to bypass some of the core elements of enterprise security defences. Compromised code can travel undetected through the firewall and passed the virus checker – straight from the internet to the device (e.g. the production server) – fully automated by the development platforms, and… Read more →
CQS & CQRS
CQS means “Command-query separation”. It was introduced by Bertrand Meyer as part of his work on the Eiffel programming language. A method is either a command performing an action, or a query that returns data, but not both. Being purely action-performing methods, commands always have a void return type. Queries, on the other hand, should not have any observable side… Read more →
Software Development Principles & Patterns
Who even gives a ****? I do. My Software Development Principles Unit Testing / Test Driven Development / Behaviour Driven Development CQRS Command and Query Responsibility Separation SOLID Single Responsibility Principle Open/Closed Principle Liskov’s Substitution Principle Interface Segregation Principle Dependency Inversion Principle AOP Aspect-Oriented Programming Unit Testing A unit as the smallest testable part of an application. In object-oriented programming, a… Read more →
My take on the Daily Stand-Up
Details Meeting to last no longer than 15 minutes Schedule as early as possible each day to work for both on- and off- shore team members What we do Summarise what you’ve done since the last meeting. Summarise what you will you do before the next meeting. Summarise what is getting in your way or keeping you from doing your… Read more →
Updated Command & Query Handlers
I’ve recently updated my definitions for Query Handlers. I’ve changed the original IQuery<Tresult> to IReturn<TResult> as, for me, it better reflects the intention of the [marker] interface. public interface ICommandHandler<TCommand> { void Execute(TCommand command); } public interface IReturn<TResult> { } public interface IQueryHandler<TQuery, TResult> where TQuery : IReturn<TResult> { TResult Execute(TQuery query); } Read more →
Get AD Group members
dsquery group -name “” | dsget group -members | dsget user -fn -ln -samid Read more →
How to give an IIS app pool folder permissions
Add the local account for the app pool using, for example, IIS AppPool\ASP.NET V4.0 Read more →
Compare XML in Powershell
Compare 2 files and get line number $abc = gc .\z.txt | %{$i = 1} { new-object psobject -prop @{LineNum=$i;Text=$_}; $i++ } $cde = gc .\x.txt | %{$i = 1} { new-object psobject -prop @{LineNum=$i;Text=$_}; $i++ } Compare-Object $abc $cde -Property Text -PassThru -IncludeEqual Read more →
Find user name from domain id
dsquery user -samid <id> or dsquery * -filter “samaccountname=<id> Read more →