Skip to content

Instantly share code, notes, and snippets.

@lodejard
lodejard / 10-event-per-category.txt
Created Nov 25, 2019
EventId.Id collosion rates
View 10-event-per-category.txt
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 Nov 21, 2019
ConsoleApp1 echo request octets
View ConsoleApp1.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>
@lodejard
lodejard / Program.cs
Last active Oct 23, 2019
write/read speed
View Program.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
namespace readmany
{
class Program
{
View example.configdictionary
foo:x=hello
foo:bar:y=world
View appsettings.json
{
"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 Jun 29, 2016
Startup with IoC enabled logger providers
View Startup.cs
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;
View go.sh
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 Dec 27, 2014
RemoveBOM xunit function
View gist:4f1273b709244273e520
[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 Nov 6, 2014
Example for kpm restore
View NuGet.config
<?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 Aug 29, 2015
libuv builder
View go.sh
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