Skip to content

Instantly share code, notes, and snippets.

@lodejard
lodejard / 10-event-per-category.txt
Created November 25, 2019 21:22
EventId.Id collosion rates
Attempt 0
Attempt 1000000
Attempt 2000000
Attempt 3000000
Attempt 4000000
Attempt 5000000
Attempt 6000000
Attempt 7000000
Attempt 8000000
Attempt 9000000
@lodejard
lodejard / ConsoleApp1.csproj
Last active November 21, 2019 21:52
ConsoleApp1 echo request octets
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>
@lodejard
lodejard / Program.cs
Last active October 23, 2019 00:08
write/read speed
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
namespace readmany
{
class Program
{
@lodejard
lodejard / example.configdictionary
Last active October 19, 2018 23:03
Switching config
foo:x=hello
foo:bar:y=world
@lodejard
lodejard / appsettings.json
Last active October 18, 2018 02:35
json and yaml
{
"configurationsetting": {
"applicationsettings": {
"metadataserviceurl": "http://usg-data.s3-website-us-east-1.amazonaws.com/metadata/getaroom-metadata.json" // can be part of request(supplier configuration)
},
"getaroomsettings": {
"TestUrl": "https://availability.integration2.testaroom.com/", // can be part of request(supplier configuration),
"ProductionUrl": "https://availability.integration2.testaroom1.com/" // can be part of request(supplier configuration)
}
},
@lodejard
lodejard / Startup.cs
Created June 29, 2016 19:58
Startup with IoC enabled logger providers
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Data.Entity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
cd ~ && wget https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
sudo dpkg -i puppetlabs-release-pc1-trusty.deb
sudo apt-get update
sudo apt-get install puppet-agent
@lodejard
lodejard / gist:4f1273b709244273e520
Created December 27, 2014 03:18
RemoveBOM xunit function
[Fact]
public void RemoveBom()
{
foreach (var file in new DirectoryInfo("..\\..").EnumerateFiles("*", SearchOption.AllDirectories))
{
try
{
var allBytes = File.ReadAllBytes(file.FullName);
var allText = File.ReadAllText(file.FullName);
if (allBytes.Length - allText.Length == 3 &&
@lodejard
lodejard / NuGet.config
Created November 6, 2014 21:56
Example for kpm restore
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
<add key="NuGetOrg" value="https://nuget.org/api/v2/" />
</packageSources>
</configuration>
@lodejard
lodejard / go.sh
Last active August 29, 2015 14:08
libuv builder
wget http://dist.libuv.org/dist/v1.4.2/libuv-v1.4.2.tar.gz
tar -xvf libuv-v1.4.2.tar.gz
cd libuv-v1.4.2/
./gyp_uv.py -f make -Duv_library=shared_library
make -C out
sudo cp out/Debug/lib.target/libuv.so /usr/lib/libuv.so.1.4.2
sudo ln -sf libuv.so.1.4.2 /usr/lib/libuv.so.1