Skip to content

Instantly share code, notes, and snippets.

View joelverhagen's full-sized avatar

Joel Verhagen joelverhagen

View GitHub Profile
@joelverhagen
joelverhagen / PackagesWithAmbiguousVersions.txt
Created November 25, 2017 00:59
Packages with versions that cause our statistics pipeline to skip them.
AspectCore.Extensions.AspectScope 0.2.0-preview7.0.1
BuildMaster.Net 1.0.0-1.0.3
BuildMaster.Net 1.0.0-1.0.4
Canducci.SqlKata.Dapper 1.0.0-beta-1.0.1
Canducci.SqlKata.Dapper 1.0.0-beta-2.0.2
Canducci.SqlKata.Dapper 1.0.0-beta-2.0.3
Canducci.SqlKata.Dapper 1.0.0-beta-2.0.4
Canducci.SqlKata.Dapper 1.0.0-beta-2.0.5
Canducci.SqlKata.Dapper 1.0.0-beta-2.0.6
Canducci.SqlKata.Dapper.MySql 1.0.0-Beta-2.0.1
@joelverhagen
joelverhagen / Routes.cs
Created November 28, 2017 00:06
Example of custom IPackageService in NuGet.Server 2.8.2
using System.Data.Services;
using System.ServiceModel.Activation;
using System.Web;
using System.Web.Routing;
using NuGet.Server;
using NuGet.Server.DataServices;
using NuGet.Server.Infrastructure;
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(WebApplication1.NuGetRoutes), "Start")]
@joelverhagen
joelverhagen / Program.cs
Created December 11, 2017 20:32
Round trip a certificate through a UTF-8 string
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
@joelverhagen
joelverhagen / Program.cs
Created April 29, 2018 16:21
Two TorSharpProxy instances running in parallel
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Knapcode.TorSharp;
namespace ConsoleApp1
{
class Program
@joelverhagen
joelverhagen / .gitattributes
Last active May 2, 2018 20:57
Generate a test CA for NuGet package signing, props to @dtivel for initial implementation
*.conf text eol=lf
*.config text eol=lf
*.sh text eol=lf
@joelverhagen
joelverhagen / Program.cs
Created May 11, 2018 00:58
Simulate problems related to using timestamp cursors against a SQL table
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@joelverhagen
joelverhagen / calls.txt
Created November 11, 2016 00:23
Variants of HTTP calls made by NuGet.exe list
[no Search()] nuget.exe list
[no Search()] nuget.exe list -allversions
[no Search(), no IsAbsoluteLatestVersion] nuget.exe list
[no Search(), no IsAbsoluteLatestVersion] nuget.exe list -allversions
GET /api/v2/Packages HTTP/1.1
GET /api/v2/Packages?$skip=100 HTTP/1.1
[no Search()] nuget.exe list -allversions -prerelease
[no Search(), no IsAbsoluteLatestVersion] nuget.exe list -allversions -prerelease
GET /api/v2/Packages()?$orderby=Id&$skip=0&$top=30 HTTP/1.1
@joelverhagen
joelverhagen / VersionConventions.md
Last active August 3, 2018 15:37
NuGet Package Version Conventions

NuGet Package Version Conventions

CI packages and release packages

A common pattern for NuGet package versions is producing two sets of .nupkgs for every CI build. That is two sets of functionally equivalent packages produced from the same source. Two sets are:

  1. CI packages: a NuGet package version that is suffixed with a build number. This allows bleeding edge consumption of the latest APIs or fixes. These packages are typically pushed to a development package feed like VSTS or MyGet. Example version numbers: 4.0.0-rc-2046, 3.5.0-rtm-1996, 3.5.0-beta2-1543
@joelverhagen
joelverhagen / Program.cs
Last active January 5, 2019 00:25
FirstAsync() works, Take(1).ToListAsync() times out, Take(1).FirstAsync() throws
using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace ConsoleApp1
{
@joelverhagen
joelverhagen / Program.cs
Created January 31, 2019 16:43
Parallel.For and async
using System;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Starting");