Skip to content

Instantly share code, notes, and snippets.

@MysterDru
MysterDru / README.md
Last active June 21, 2024 04:52
KCDC - Source Generator Workshop

Getting Started With Roslyn Source Generators

Below are the prerequisites for Let's Generate Some Code! Getting Started with Roslyn Source Generators workshop @ KCDC 2024.

During the workshop we'll create a new solution that includes a few projects.

Knowledge

  • Know your way around debugging with C# in your IDE of choice (see below)
@MysterDru
MysterDru / EntityFrameworkMoqHelper.cs
Created April 1, 2022 14:03
EntityFrameworkMockHelper
public static class EntityFrameworkMoqHelper
{
/// <summary>
/// Create a mock instance for DbSet
/// </summary>
/// <typeparam name="T">Associated type (class) on dbset of the DbContext</typeparam>
/// <returns>Simple mocked DbSet</returns>
public static Mock<DbSet<T>> CreateMockForDbSet<T>() where T : class
{
return new Mock<DbSet<T>>();
@MysterDru
MysterDru / FABLayout.xaml
Created February 23, 2022 17:31
Xamarin Forms Floating Acting Button Layout
<AbsoluteLayout>
<ContentView
AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0,0,1,1">
</ContentView>
<ContentView
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
HorizontalOptions="End"
VerticalOptions="End"
@MysterDru
MysterDru / resign-ipa.md
Created February 22, 2022 19:34 — forked from ryantan/resign-ipa.md
How to resign an .ipa

How to Resign an iOS App

Let's say you receive an app (e.g. MyApp.ipa) from another developer, and you want to be able to install and run it on your devices (by using ideviceinstaller, for example).

Or your certificates and provision profiles have expired and you want to provide a new build to your clients without having to make a new build on the latest XCode or iOS SDK.

Prepare New Signing Assets

The first step is to attain a Provisioning Profile which includes all of the devices you wish to install and run on. Ensure that the profile contains a certificate that you have installed in your Keychain Access (e.g. iPhone Developer: Some Body (XXXXXXXXXX) ). Download the profile (MyProfile.mobileprovision) so you can replace the profile embedded in the app.

@MysterDru
MysterDru / output.json
Last active March 12, 2020 20:35
Privateer Press Card Database Id Retriever
[{"name":"The Child","cardId":"4399"},{"name":"The Dreamer","cardId":"4402"},{"name":"The Heretic","cardId":"4403"},{"name":"The King of Nothing","cardId":"4406"},{"name":"The Wanderer","cardId":"4409"},{"name":"Zevanna Agha, the Fate Keeper","cardId":"4407"},{"name":"Cage Rager","cardId":"4408"},{"name":"Clockatrice","cardId":"4404"},{"name":"Crabbit","cardId":"4405"},{"name":"Frightmare","cardId":"4410"},{"name":"Gorehound","cardId":"4414"},{"name":"Rattler","cardId":"4411"},{"name":"Skin & Moans","cardId":"4412"},{"name":"Dread Rots","cardId":"4413"},{"name":"Hollow Holden","cardId":"4421"},{"name":"Hollowmen","cardId":"4416"},{"name":"Lantern Man","cardId":"4417"},{"name":"Mad Caps","cardId":"4415"},{"name":"Malady Man","cardId":"4422"},{"name":"Murder Crows","cardId":"4419"},{"name":"Neigh Slayer War Horse (Command Attachment)","cardId":"4420"},{"name":"Neigh Slayers","cardId":"4418"},{"name":"Piggyback Officer (Command Attachment)","cardId":"4423"},{"name":"Piggybacks","cardId":"3696"},{"name":"Twilight
@MysterDru
MysterDru / build.sh
Created February 26, 2020 04:56
Build Scripts for WYAM on Netlify
#!/bin/bash
# this is needed to get dotnet to run on netlify build image
export DOTNET_ROOT=/opt/buildhome/.dotnet
#install dotent 2.x, required for wyam to work
./dotnet-install.sh --version 2.2.207
# instal waym tools
dotnet tool install -g Wyam.Tool
# change directory to site root
@MysterDru
MysterDru / careers-output.json
Created October 8, 2019 15:21
Parse IKRPG.info Character Generator Data
{"Alchemist":{"defaults":{"careers":{"static":true,"choose":0,"chooseGroup":false,"options":["Alchemist"]},"abilities":{"static":true,"choose":0,"chooseGroup":false,"options":["Grenadier","Poison Resistance"]},"military skills":{"static":true,"choose":0,"chooseGroup":false,"options":["Hand Weapon","Thrown Weapon"]},"occupational skills":{"static":true,"choose":0,"chooseGroup":false,"options":["Alchemy","Medicine"]},"gold":{"static":true,"choose":0,"chooseGroup":false,"options":["50"]},"armors":{"static":true,"choose":0,"chooseGroup":false,"options":["Alchemist's Leather"]},"gear":{"static":true,"choose":0,"chooseGroup":false,"options":["gas mask","travelling alchemist's kit","grenadier's bandolier","any alchemical grenate","any alchemical grenate","any alchemical grenate","any alchemical grenate","any alchemical grenate"]}},"choose":[]},"Arcane Mechanik":{"defaults":{"careers":{"static":true,"choose":0,"chooseGroup":false,"options":["Arcane Mechanik"]},"abilities":{"static":true,"choose":0,"chooseGroup":false
@MysterDru
MysterDru / AppCenterTarget.cs
Last active September 28, 2018 03:42
NLog Xamarin (file, appcenter, console)
using System.Collections.Generic;
using NLog;
using NLog.Targets;
public sealed class AppCenterTarget : TargetWithLayout
{
public AppCenterTarget()
{
}
@MysterDru
MysterDru / AndroidEntryRenderer.cs
Last active January 18, 2022 14:28
Next/Prev Buttons For Xamarin.Forms Entries
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Android.Content;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(Entry), typeof(YourNamespace.Droid.Renderers.AndroidEntryRenderer))]
namespace YourNamespace.Droid.Renderers
@MysterDru
MysterDru / AppData.json
Last active September 15, 2018 17:48
CWITC 2018 App Data
{
"sessions": [
{
"Abstract": "Community, is a word we started using at the start of the 14th century, as a way to define a set of common people. In today’s tech scene, we hear this word used everywhere but do you really feel part of one? For the past decade I’ve spent over 10k hours fostering and developing different communities. Some small, and some large efforts such as THAT Conference but what I’ve come to learn is what I’m here to share.\n\nBeing part of a community is easy, being present and active is something completely different. Many will sign up but won’t even bother showing up, The networks, the opportunities, the support are all right in front of you but you have to take the step, that second step. I’ll explain today’s landscape, explore a few techniques, and help you take that second step.",
"EndTime": "2018-10-06T14:45:00-06:00",
"Id": "b34417eb-dc35-419f-b434-cce65b6155cd",
"MainCategory": {
"Color": "#4B637E",
"Id": "ba93bcc2-0ca4-4041-be41-8eb885