Skip to content

Instantly share code, notes, and snippets.

@jongyllen
jongyllen / gist:1187db33f6da0da858d46c1d47be9c02
Created June 10, 2019 10:57
Debugging azure and windbg
Get-Process -Name dotnet
d:\devtools\sysinternals\procdump -accepteula -ma 1234
subst d: c:\temp\temp
.load C:\Users\Jon Gyllenswärd\Downloads\sos.dll
.cordll -I coreclr.dll -N -ve
!runaway
~Xs
!CLRStack -p
@jongyllen
jongyllen / gist:f24ef118a1d9fa53ca1c5d40c2080d5a
Created April 9, 2019 07:05
Install specific azure function core tools version
npm i -g [email protected] --unsafe-perm true
<?xml version="1.0"?>
<log4net>
<appender name="RollingFileInfoAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="C:\\Logs\\WebLog_info_"/>
<AppendToFile value="true"/>
<MaxSizeRollBackups value="10"/>
<MaximumFileSize value="10MB"/>
<datePattern value="yyyyMMdd'.log'" />
<rollingStyle value="Composite" />
<staticLogFileName value="false" />
@jongyllen
jongyllen / ProbabilityKata
Created July 6, 2016 08:34 — forked from gregoryyoung/ProbabilityKata
Greg Young's Probability Kata
Value objects are an important concept in DDD. This kata is made both to learn value objects and to learn better ways of testing.
Write a probability value object. It should contain the following methods:
Probability CombinedWith(Probability)
Probability InverseOf()
Probability Either(Probability)
if you forget your probability math:
Either:P(A) + P(B) - P(A)P(B)
CombinedWith: P(A)P(B)
var PORT = 9999;
var HOST = '127.0.0.1';
var dgram = require('dgram');
var server = dgram.createSocket('udp4');
server.on('listening', function () {
var address = server.address();
console.log('UDP Server listening on ' + address.address + ":" + address.port);
});
param(
[parameter(Mandatory=$true, ValueFromPipeline=$true)]
[string]
$data,
[parameter(Mandatory=$false, ValueFromPipeline=$true)]
[string]
$ip="127.0.0.1",
[parameter(Mandatory=$false, ValueFromPipeline=$true)]
@jongyllen
jongyllen / gist:6681278
Created September 24, 2013 07:09
GIT - Sync fork
git remote -v
git remote add upstream https://github.com/otheruser/repo.git
git remote -v
git fetch upstream
git branch -va
git checkout master
git merge upstream/master
@jongyllen
jongyllen / gist:6681267
Created September 24, 2013 07:07
GIT - reset fork
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
@jongyllen
jongyllen / gist:1831466
Created February 14, 2012 23:11
Greg Young Probability kata proposed solution #1
using System;
using NUnit.Framework;
namespace ProbabilityKata
{
[TestFixture]
public class ProbabilityTests
{
[Test]
public void CanCompareTwoEqualProbabilities()