Skip to content

Instantly share code, notes, and snippets.

View andrewabest's full-sized avatar

Andrew Best andrewabest

View GitHub Profile
@andrewabest
andrewabest / SubmissionOne.md
Last active December 27, 2015 03:19
DDD Brisbane 2013 Submissions

Demystifying WPF

Abstract

Everyone is a web guy these days. And web guys don't like WPF. That is fair enough, but I contend it is because the learning curve for 'decent WPF' is much steeper than 'decent web' pauses for heckles, and this is due to the fact that ASP.net MVC now has so much functionality supplied right out of the box - no one needs to ask 'how should I be doing X these days?' for even moderately complex applications.

Here we will look at how to get started building a truly modern application with WPF; which frameworks and packages provide us with the most bang per buck right out of the gate; and how we can deal simply and cleanly with basic, critical functionality such as data validation, command execution and messaging.

We will then wrap it all up in a neat little Visual Studio template so that we don't need to reinvent the wheel each time we go File > New > Project > WPF Application.

@andrewabest
andrewabest / MarkdownCheatsheet.md
Created October 31, 2013 22:56
Markdown Cheatsheet

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@andrewabest
andrewabest / Deploy.ps1
Created February 2, 2014 22:49
An example Octopus deployment script for WPF ClickOnce applications.
Write-Host 'Copy the package payload over to the clickonce web application location'
$source = ".\"
$dest = "C:\Octopus\Applications\${OctopusEnvironmentName}\NextGen.ClickOnce\${OctopusPackageVersion}\Package"
$exclude = @('*.pdb','mage.exe', '*.ps1', '*Build*', '*.pfx')
$appManifestName = "${OctopusPackageName}.exe.manifest"
$appManifestPath = Join-Path $dest $appManifestName
$deployManifestPath = Join-Path $dest "${OctopusPackageName}.application"
@andrewabest
andrewabest / SubmissionOne.md
Last active August 29, 2015 14:07
DDD Brisbane 2014 Submissions

X-ray Goggles

Abstract

Are you a product owner? Do you have a product out in the wild, but can't answer who is using what features? Are you a developer? Are you currently developing a product but can't tell your product owner or boss which bugs are occurring out in the wild most frequently? Do you dabble in support? Can you provide the development team with deep information regarding defects your customers are screaming at you about? When someone says to you 'it's slow', and you of course respond with 'which part?' and the unquenchable fountain of insight that is your product owner / tester / end user says 'the whole thing' - do you have any data you can point to?

You need to know what is going on in your products from day one, and finding out shouldn't involve pushing out new builds to add more Trace.WriteLines / StopWatch.StartNews or logging onto various azure cloud service instances to pore over text log files. Lets take a look at some of the tooling and services available to us today and build a

@andrewabest
andrewabest / AppendFileHash.cs
Created December 16, 2014 04:25
Cache Busting in MVC local
public class AppendFileHash : IBundleTransform
{
public void Process(BundleContext context, BundleResponse response)
{
foreach (var file in response.Files)
{
using (var fs = File.OpenRead(HostingEnvironment.MapPath(file.IncludedVirtualPath)))
{
var hash = new SHA256Managed().ComputeHash(fs);
var version = HttpServerUtility.UrlTokenEncode(hash);
@andrewabest
andrewabest / gource.bat
Created December 18, 2014 23:36
Gource
// 3s/day
c:\temp\gource\gource.exe -o out.ppm -r 25 -s 3 -a 1 --colour-images --hide filenames
c:\temp\ffmpeg\bin\ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i out.ppm -vcodec libx264 -threads 0 gource..avi -fpre "c:\temp\ffmpeg\presets\libvpx-720p.ffpreset"
// Fast 1s/day
c:\temp\gource\gource.exe -o out.fast.ppm -r 25 -s 1 -a 1 --colour-images --hide filenames --font-size 6
c:\temp\ffmpeg\bin\ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i out.fast.ppm -vcodec libx264 -threads 0 gource.fast.avi -fpre "c:\temp\ffmpeg\presets\libvpx-720p.ffpreset"
@andrewabest
andrewabest / CreateCertificateAuthorityCert.bat
Last active November 2, 2021 06:29
Create a cert authority and client certificate for development using makecert.exe
:: Courtesy of http://www.digitallycreated.net/Blog/38/using-makecert-to-create-certificates-for-development
:: To see what certificates you currently have on your PC, open MMC (Run->mmc.exe), click "File->Add/Remove Snap-in", select Certificates from the left list, click "Add". Select "My user account", which will mean the snapin will show certificates that are stored specifically for your Windows user account. Select Certificates from the list again and "Add" it, then this time select "Computer account". This snapin will show certificates belonging to the machine specifically, and will apply across all accounts. Press Finish, then OK. I suggest you Save this MMC arrangement, so you can get back to it more easily in the future (File->Save).
:: Expand "Certificates (Local Computer)\Trusted Root Certification Authorities\Certificates". This folder shows you all the Certificate Authorities that your computer trusts.
:: So now we need to create our own Certificate Authority certificate. Open the Visual Studio
@andrewabest
andrewabest / WebStream.cs
Created February 7, 2015 04:10
Example Proxy Handling from ServiceBus
// Generated by .NET Reflector from C:\projects\nextgen\packages\WindowsAzure.ServiceBus.2.1.4.0\lib\net40-full\Microsoft.ServiceBus.dll
namespace Microsoft.ServiceBus
{
using Microsoft.ServiceBus.Common;
using Microsoft.ServiceBus.Tracing;
using System;
using System.Globalization;
using System.IO;
using System.Net;
using System.Net.Cache;
http://www.infoq.com/articles/Continuous-Delivery-Maturity-Model
@andrewabest
andrewabest / SevenYearItch.md
Last active August 29, 2015 14:16
The abstract and basic outline of my March BDN meetup presentation.

The Seven Year Itch

Abstract

In this session Andrew will refactor an existing Angular web application to React, and then measure the outcomes to validate whether React is a viable alternative to Angular.

With Angular nearing its seventh year of life and approaching obselecense, is it time we entertain the idea of seeing new front-end frameworks? Andrew's inspiration for this framework promiscuity came from a conversation he had with colleagues one day around getting Angular to perform a particular task. The outcome of the particular conversation was much introspection as to why we put ourselves through such pain when developing software - so as any good developer does, Andrew is going to see what we can do to make the pain go away.