Skip to content

Instantly share code, notes, and snippets.

View joelverhagen's full-sized avatar

Joel Verhagen joelverhagen

View GitHub Profile

Keybase proof

I hereby claim:

  • I am joelverhagen on github.
  • I am joelverhagen (https://keybase.io/joelverhagen) on keybase.
  • I have a public key whose fingerprint is 118C 6DDC 8F74 9972 8C1F 8C12 614B F64D 61B1 0094

To claim this, I am signing this object:

@joelverhagen
joelverhagen / Program.cs
Created October 27, 2017 20:23
Determine package size using NuGet V3 API
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using NuGet.Common;
using NuGet.Frameworks;
using NuGet.Packaging.Core;
using NuGet.Protocol;
using NuGet.Protocol.Core.Types;
using NuGet.Versioning;
@joelverhagen
joelverhagen / gist:fde5a70d672620128da07c4a963c8ad4
Created November 8, 2017 23:05
NuGet.org package IDs ending in digits
1.0 1.0.0
1.0.0 1.0.0
1.0.0.0 1.0.0
1.0.10 1.0.30
1.0.2.3 1.0.2.3
1.0.2.4 1.0.2.4
1.1 1.0.0
1.111 1.111.0
5.0.0.0 5.0.0
Aalmaram.4.0 2.0.0
@joelverhagen
joelverhagen / FindLatestNuGetVersion.ps1
Last active November 10, 2017 02:17
Latest version of a NuGet package in PowerShell
# See: https://docs.microsoft.com/en-us/nuget/api/service-index
$serviceIndex = Invoke-RestMethod "https://api.nuget.org/v3/index.json"
$searchUrl = $serviceIndex.resources `
| ? { ($_ | Select -ExpandProperty "@type") -eq "SearchQueryService" } `
| % { $_ | Select -ExpandProperty "@id" } `
| Select-Object -First 1
$packageId = "NuGet.Versioning"
$includePrerelease = $true
@joelverhagen
joelverhagen / Output.md
Last active November 23, 2017 06:38
Demonstrate the case sensitivity properties of different NuGet.org components
Area A ?? B Out A Out B
Azure Blob Storage I != i
Azure Blob Storage ı != i
Azure Blob Storage ı != I
Azure Blob Storage İ != i
Azure Blob Storage İ != I
Azure Blob Storage İ != ı
Lucene LowerCaseFilter I == i
Lucene LowerCaseFilter ı != i
@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 / .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 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 February 13, 2018 19:06
NuGet API, get download count per version
// All you need is the NuGet.Protocol package from NuGet.org.
using System;
using System.Threading;
using System.Threading.Tasks;
using NuGet.Common;
using NuGet.Protocol;
using NuGet.Protocol.Core.Types;
namespace ConsoleApp1
{