Skip to content

Instantly share code, notes, and snippets.

@nat-n
nat-n / bp_grcpio_example_usage.py
Last active November 2, 2020 16:20
POC for using betterproto with grpcio without generated a servicer
from magic_glue import create_grpc_handler, rpc_method
from .generated_code.mypackage import MyRequest, MyResponse
# Create a servicer class with the rpc methods we want to implement
class MyServicer:
# grpcio needs to know the fully qualified name of the service
# It would be better if this was available from the betterproto generated classes
# to save having to copy it from the proto file manually
service_name = "mypackage.MyService"
@cpyfferoen
cpyfferoen / NugetManager.cs
Last active June 28, 2024 09:53
NuGet API wrapper to search/install packages WITH AUTHENTICATION the same way Nuget.Exe/Client does it - looks up CredentialProviders and plugins (also for Credentials). Specific use case was Azure DevOps feed access.
using NuGet.Common;
using NuGet.Configuration;
using NuGet.Credentials;
using NuGet.PackageManagement;
using NuGet.Packaging;
using NuGet.Packaging.Core;
using NuGet.Packaging.Signing;
using NuGet.ProjectManagement;
using NuGet.Protocol;
using NuGet.Protocol.Core.Types;
using NuGet.Common;
using NuGet.Configuration;
using NuGet.Frameworks;
using NuGet.Packaging;
using NuGet.Packaging.Core;
using NuGet.Packaging.Signing;
using NuGet.Protocol;
using NuGet.Protocol.Core.Types;
using NuGet.Resolver;
using NuGet.Versioning;
@awidegreen
awidegreen / vim_cheatsheet.md
Last active June 17, 2024 03:41
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close