Skip to content

Instantly share code, notes, and snippets.

View janpieterz's full-sized avatar

Jan-Pieter George janpieterz

View GitHub Profile
@janpieterz
janpieterz / index.js
Last active March 7, 2023 14:15
Trinsic Credential with File Attachment
import {FieldType, TrinsicService} from "@trinsic/trinsic";
import fs from "fs";
import https from "https";
let trinsic = new TrinsicService();
trinsic.options.authToken = process.env.TRINSIC_AUTH_TOKEN;
//Just doing this dance so that I can detect the ecosystem and not keep re-creating the template
const info = await trinsic.provider().ecosystemInfo();
@janpieterz
janpieterz / RoundRobinPartitioningFailoverStrategy.cs
Created November 21, 2017 13:13
NServiceBus RoundRobinFailoverPartitioningStrategy
public class RoundRobinPartitioningFailoverStrategy : INamespacePartitioningStrategy
{
private readonly CircularBuffer<RuntimeNamespaceInfo[]> _namespaces;
public RoundRobinPartitioningFailoverStrategy(ReadOnlySettings settings)
{
if (!settings.TryGet("AzureServiceBus.Settings.Topology.Addressing.Namespaces",
out NamespaceConfigurations namespaces))
{
throw new ConfigurationErrorsException($"The '{nameof(RoundRobinPartitioningFailoverStrategy)}' strategy requires exactly two namespaces to be configured, please use {nameof(AzureServiceBusTransportExtensions.NamespacePartitioning)}().{nameof(AzureServiceBusNamespacePartitioningSettings.AddNamespace)}() to register the namespaces.");
}
@janpieterz
janpieterz / Nuget failures
Created October 11, 2017 07:50
VSTS nuget failures
NuGet.Protocol.Core.Types.FatalProtocolException: The feed 'NuGet official package source [https://api.nuget.org/v3/index.json]' lists package 'System.Numerics.Vectors.4.1.1' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again. ---> NuGet.Protocol.PackageNotFoundProtocolException: Unable to find package 'System.Numerics.Vectors.4.1.1'.
at NuGet.Protocol.FindPackagesByIdNupkgDownloader.<GetNuspecReaderFromNupkgAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.HttpFileSystemBasedFindPackageByIdResource.<GetDependencyInfoAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown
@janpieterz
janpieterz / Blockstack partial disclosure.md
Last active August 18, 2016 20:45
Blockstack partial identity disclosure

In the podcast Epicenter Bitcoin 101 Ryan descibes a method of selectively disclosing information to a third party ( ~50:00 - 55:00).

In below description we use a simplified version of a Person to demonstrate the concept.

{
  name: 'Jan-Pieter Zoutewelle',
  birthDate: { value:  '18-02-1991', subValues: [{'above21': true, 'above18': true}]},
  birthPlace: 'Ridderkerk, The Netherlands'
}
@janpieterz
janpieterz / keybase.md
Created August 17, 2016 08:40
keybase.md

Keybase proof

I hereby claim:

  • I am janpieterz on github.
  • I am janpieterz (https://keybase.io/janpieterz) on keybase.
  • I have a public key ASDb6J1oAnk46UwrBUAR3O0ZEcUHpKecMJP6Ti1CgyKcUAo

To claim this, I am signing this object:

@janpieterz
janpieterz / index.js
Created November 3, 2015 10:50
superagent-bluebird-promise version 3 fix
// From https://gist.github.com/epeli/11209665
var Promise = require("bluebird");
// So you can `var request = require("superagent-bluebird-promise")`
var superagent = module.exports = require("superagent");
var Request = superagent.Request;
Promise.config({
// Enable warnings.
@janpieterz
janpieterz / project.json
Created September 14, 2015 08:13
Failing removal of dependencies
{
"webroot": "wwwroot",
"userSecretsId": "xx",
"version": "1.0.0-*",
"dependencies": {
"EntityFramework.Commands": "7.0.0-beta7",
"EntityFramework.SqlServer": "7.0.0-beta7",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta7",
"Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta7",
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showFileExtensions -EnableShowFullPathInTitleBar
cinst TelnetClient -source windowsFeatures
cinst notepadplusplus.install
cinst baretail
cinst 7zip.install
cinst virtualbox
cinst fiddler
cinst teamviewer
Verifying I am +janpieterz on my passcard. https://onename.com/janpieterz
@janpieterz
janpieterz / Program.cs
Created March 4, 2015 13:03
Serilog and Topshelf
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Serilog;
using Serilog.Extras.Topshelf;
using Topshelf;
using Topshelf.Logging;
namespace ConsoleApplication1
{