Skip to content

Instantly share code, notes, and snippets.

View jennings's full-sized avatar
🦄
What a mess I've made

Stephen Jennings jennings

🦄
What a mess I've made
View GitHub Profile
function Enumerable(arr) {
this.toArray = function () {
return arr
}
this.filter = function (fn) {
return new Enumerable(arr.filter(fn))
}
this.map = function (fn) {
@jennings
jennings / software-lifecycle-services.md
Last active April 26, 2017 17:06
Software Lifecycle Services
@jennings
jennings / README.md
Last active June 30, 2017 06:42
Function currying in JavaScript

A simple function for allowing partial function application in JavaScript.

function foo(a, b, c) {
    return [a, b, c]
}

var bar = foo.curry(1, 2)
bar(3)                      // => [1, 2, 3]
@jennings
jennings / jspretty.cmd
Created January 19, 2017 22:20
Reads JSON from STDIN, formats it, and prints it to STDOUT.
@echo off
node "%~dp0\jspretty.js"
@jennings
jennings / words.md
Last active October 25, 2016 23:20

High availability

Process

  • Mirroring
  • Replication

Components

  • Principal / Replica
@jennings
jennings / windbg-notes.md
Last active June 1, 2023 05:12
Debugging .NET with WinDbg feels like wizardry, so naturally I want to get better at it.

Load PSSCOR4:

.loadby sos clr
.load C:\Debug\Psscor4\amd64\psscor4.dll

or:

@jennings
jennings / WcfExtensibilityPoints.md
Last active September 26, 2020 06:09
I can never remember how to extend WCF in the ways that I want.

A good summary of all the extensibility points: https://blogs.msdn.microsoft.com/carlosfigueira/2011/03/14/wcf-extensibility/

Doing stuff before/after calls

Use IOperationInvoker if you need to do "runtime-y" things, such as replacing the current SynchronizationContext (perhaps with one that restores OperationContext after an await...).

But! You can only apply an IOperationInvoker from an IOperationBehavior, not from a IServiceBehavior. If you try to assign an operation invoker from a service behavior, WCF will eventually just overwrite it. If you want to apply an IOperationInvoker to every operation in a contract, you can write an IServiceBehavior which applies the IOperationBehavior to every operation.

You can have an attribute which can apply to a whole service, or to a single operation:

@jennings
jennings / Windows10-Setup.ps1
Last active May 6, 2016 19:47 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@jennings
jennings / keybase.md
Created April 17, 2016 05:39
Keybase proof

Keybase proof

I hereby claim:

  • I am jennings on github.
  • I am jennings (https://keybase.io/jennings) on keybase.
  • I have a public key ASAr3xJbZmMFK6kV8HoTTo1vRKFb4PjLj55jcdht_igINAo

To claim this, I am signing this object:

@jennings
jennings / Program.cs
Last active December 5, 2015 23:12
A sample program for Stack Overflow question 34111695 (http://stackoverflow.com/q/34111695/19818)
// See: http://stackoverflow.com/q/34111695/19818
namespace StackOverflow34111695
{
using System;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;