Skip to content

Instantly share code, notes, and snippets.

@xiaomi7732
xiaomi7732 / PolymorphicSerialization.md
Last active January 6, 2023 22:58
How do I leverage .NET 7 Polymorphic Serialization when building Roshambo API

How did I leverage .NET 7 Polymorphic Serialization when building Roshambo API

Brief about the Roshambo project

It is a simple rock, paper, and scissors game used to study how to build a full RESTful API. You will be able to find the latest code in this repo. BTW, if you like it, give it a star.

To make it fun, I also released a live client at https://roshambo.codewithsaar.com.

The feature I want to build

@praeclarum
praeclarum / mactestflight.yaml
Created January 5, 2023 19:22
GitHub Actions to build a Mac AppStore app
- name: Import Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
create-keychain: true
keychain-password: ${{ secrets.APPSTORE_CERTIFICATE_P12_PASSWORD }}
p12-file-base64: ${{ secrets.APPSTORE_CERTIFICATE_P12 }}
p12-password: ${{ secrets.APPSTORE_CERTIFICATE_P12_PASSWORD }}
- name: Import Mac Installer Certificate
uses: apple-actions/import-codesign-certs@v1
@RolandPheasant
RolandPheasant / EnsureUniqueChanges.cs
Last active October 7, 2020 17:56
Unique changes
public static class ChangeSetEx
{
public static IObservable<IChangeSet<TObject, TKey>> EnsureUniqueChanges<TObject, TKey>(this IObservable<IChangeSet<TObject, TKey>> source)
{
return source.Select(EnsureUniqueChanges);
}
public static IChangeSet<TObject, TKey> EnsureUniqueChanges<TObject, TKey>(this IChangeSet<TObject, TKey> input)
{
var changes = input
@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
{
@webframp
webframp / keybase.md
Created July 25, 2017 18:14
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@thomaslevesque
thomaslevesque / CSharpErrorsAndWarnings.md
Last active April 11, 2024 21:35
All C# errors and warnings. NOTE: this list is out of date. See https://github.com/thomaslevesque/GenerateCSharpErrors/blob/master/CSharpErrorsAndWarnings.md for a more recent version

All C# errors and warnings

Parsed from the Roslyn source code using Roslyn.

Code Severity Message
CS0006 Error Metadata file '{0}' could not be found
CS0009 Fatal Metadata file '{0}' could not be opened -- {1}
CS0012 Error The type '{0}' is defined in an assembly that is not referenced. You must add a reference to assembly '{1}'.
CS0016 Error Could not write to output file '{0}' -- '{1}'
@dannycabrera
dannycabrera / Log.cs
Created March 24, 2017 19:10
NSLog workaround for Xamarin Console.WriteLine bug
const string FoundationLibrary = "/System/Library/Frameworks/Foundation.framework/Foundation";
[System.Runtime.InteropServices.DllImport(FoundationLibrary)]
extern static void NSLog(IntPtr format, IntPtr s);
[System.Runtime.InteropServices.DllImport(FoundationLibrary, EntryPoint = "NSLog")]
extern static void NSLog_ARM64(IntPtr format, IntPtr p2, IntPtr p3, IntPtr p4, IntPtr p5, IntPtr p6, IntPtr p7, IntPtr p8, IntPtr s);
static readonly bool Is64Bit = IntPtr.Size == 8;
static readonly bool IsDevice = ObjCRuntime.Runtime.Arch == ObjCRuntime.Arch.DEVICE;
@ankurk91
ankurk91 / github_gpg_key.md
Last active April 9, 2024 16:34
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@omnibs
omnibs / 101-rx-samples.md
Last active April 21, 2024 04:36
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress

@tonysneed
tonysneed / Mac OS X: Open in Visual Studio Code
Last active March 27, 2024 10:02
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"