Skip to content

Instantly share code, notes, and snippets.

Set-WindowsExplorerOptions -EnableShowFileExtensions
Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Server -All
cinst python2
cinst git
cinst ravendb3
cinst sql-server-2017
cinst sql-server-management-studio
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Server -All
wsl --install
choco install microsoft-windows-terminal
choco install git
choco install dotnet
choco install nodejs
choco install visualstudiocode
[TestFixture]
public class Test1
{
[Test]
public async Task TestSavesThings()
{
var result = await DoSomeAsync();
Assert.True(result);
}
@AndyStewart
AndyStewart / Nulls.cs
Created August 18, 2015 20:49
Null Handling
using System.Collections.Generic;
using System.Linq;
namespace Nulls
{
public class Repository
{
private readonly List<Person> _persons = new List<Person>()
{
new Person { FirstName = "Bob", Surname = "Smith"},
@AndyStewart
AndyStewart / Contact.cs
Last active October 5, 2016 13:11
Builder Pattern
public class Contact
{
public Contact(string firstname, string surname, string address)
{
this.Firstname = firstname;
this.Surname = surname;
this.Address = address;
}
public string Firstname { get; private set; }
public string Surname { get; private set; }
@AndyStewart
AndyStewart / CheeseAndScrewdriver.clj
Created March 8, 2015 19:08
Cheese And Screwdriver
(ns cheesescrewdriver.core-test
(:use [midje.sweet]))
(def today "1/03/2015")
(defn is-expiry-date-today [date]
(= date today))
(defn get-price [product]
(product :price))
@AndyStewart
AndyStewart / GuildedRose.cs
Created December 16, 2014 13:21
Functional c# Gilded Rose
using System;
using System.Collections.Generic;
namespace GildedRose
{
public class GildedRose
{
private static readonly Dictionary<string, Action<Item>> Products = new Dictionary<string, Action<Item>>
{
{"Aged Brie", Product.Adjust(Adjusters.QualityAdjustedBy(1))},
@AndyStewart
AndyStewart / Items.cs
Created December 1, 2014 22:36
Gilded Rose
using System;
namespace gildedrose
{
public class GildedRose
{
// private static List<Item> items = null;
//
// public static void main(String[] args) {
@AndyStewart
AndyStewart / fileResizer.js
Last active August 29, 2015 14:08
Playing with JS Syntax.
function fileResizer(fileRepository, fileStore, renderThumbnail) {
function listen(event) {
event.data.files.forEach(function(id) {
getFileContents(id, renderThumbnailToStore);
});
}
function getFileContents(id, next) {
fileRepository.getById(id, function(err, file) {
@AndyStewart
AndyStewart / eventStore.js
Last active August 29, 2015 14:01
Reading from eventStore using node.js
var request = require('request');
var async = require('async');
function eventStore() {
function createEvent(event, body) {
return {
data: body,
type: event.summary
};
}