Skip to content

Instantly share code, notes, and snippets.

@davidobrien1985
davidobrien1985 / azure-sql-deploy.json
Created May 15, 2018 12:45
Azure SQL ARM template
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"administratorLogin": {
"type": "string"
},
"sqlPassword": {
"type": "securestring"
},
#r @"packages\Streams.0.2.5\lib\Streams.Core.dll"
open System
open System.IO
open System.Collections.Generic
open Nessos.Streams
// make Visual Studio use the script directory
Directory.SetCurrentDirectory(__SOURCE_DIRECTORY__)
namespace JsonParser
open System
open NUnit.Framework
module Json =
type Token =
| String of string
| Number of string
@ar3cka
ar3cka / gist:ed2217ee17f6bd3f2a91
Last active February 18, 2023 21:45
CQRS. In Process Command Dispatcher
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
using System.Threading.Tasks;
namespace Demo
{
@scottmcarthur
scottmcarthur / App.ts
Created February 17, 2014 14:33
Source code for http://stackoverflow.com/questions/21796849/angularjs-typescript-routing (Not my personal TypeScript format)
/// <reference path="angular.d.ts" />
/// <reference path="angular-route.d.ts" />
'use strict';
// Create and register modules
var modules = ['app.controllers','app.directives', 'app.filters', 'app.services'];
modules.forEach((module) => angular.module(module, []));
// *** Push ngRoute or $routeProvider won't work ***
@RhysC
RhysC / 1_MVCHelper.txt
Last active January 2, 2016 16:28
MVC test helpers (.net 4.5) using Log4net, NSubstitute and xUnit. Intend for : - checking attributation of the controller and actions. - asserting ActionResult values in a fluent manner - reducing set up noise for underling type that help form a testable controller
Example usages:
public class MyControllerFixture : IUseFixture<ControllerFixtureInit>
{
private readonly MyController _sut;
private ControllerTestContext _controllerTestContext;
private readonly IMyDependency _dependency;
public MyControllerFixture()
{
@jogleasonjr
jogleasonjr / SlackClient.cs
Last active October 20, 2023 15:54
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@clupasq
clupasq / RunnableInDebugOnlyAttribute.cs
Created August 8, 2013 05:45
xUnit.net RunnableInDebugOnlyAttribute
public class RunnableInDebugOnlyAttribute : FactAttribute
{
private string _skip;
public override string Skip
{
get
{
return Debugger.IsAttached
? _skip
@diegofrata
diegofrata / Repository.fs
Last active December 10, 2015 06:28 — forked from anonymous/Repository.fs
Very Simple MongoDB Repository for F#
open System.Collections
open System.Configuration
open System.Data.Entity.Design.PluralizationServices
open System.Linq
open FluentMongo.Linq
open MongoDB.Bson
open MongoDB.Driver
open MongoDB.Driver.Builders
@RhysC
RhysC / MachineSetup.ps1
Last active May 25, 2016 08:13
Dev machine PC set up **NB* *: You must have your execution policy set to unrestricted for this to work (Set-ExecutionPolicy Unrestricted). There have been reports that RemoteSigned is enough for the install to workUses Chocolatey and PS-Get to do the heavy lifting TAGS chocolatey setup build
$ErrorActionPreference = "Stop"
Set-ExecutionPolicy RemoteSigned
ECHO "Installing PsGet and PS plugins"
iex ((new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1"))
Install-Module pscx
Install-Module psake
ECHO "FINISHED - Installing PsGet and PS plugins - FINISHED"