Skip to content

Instantly share code, notes, and snippets.

View radj307's full-sized avatar

radj307 radj307

  • London, ON, Canada
  • 23:27 (UTC -04:00)
View GitHub Profile
@radj307
radj307 / GetKeyName.hpp
Last active December 16, 2023 01:15
[Win32] How to get the full name of a keyboard key in C++ and C#
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <string>
std::wstring KeyNameFromScanCode(const unsigned scanCode)
{
wchar_t buf[32]{};
GetKeyNameTextW(scanCode << 16, buf, sizeof(buf));
return{ buf };
@radj307
radj307 / ActionFeedbackAdorner.cs
Last active December 15, 2023 03:07
WPF ActionFeedbackAdorner
using System;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace AFA
{
public class ActionFeedbackAdorner : Adorner
{
@radj307
radj307 / README.md
Last active December 9, 2023 19:17
C# continuous integration automated versioning helper script

C# CI Helper Script for PowerShell

SetProperty.ps1 is a PowerShell script that, contrary to its name, can get or set any number of properties in the first PropertyGroup element in a .csproj or .props file. The file is only saved if changes were made.

I use this in my github actions workflows to update my project's version number(s) when I push a new tag, feel free to do the same. You have my permission to include this in your projects and version control system with or without crediting me.

Usage

SetProperty
@radj307
radj307 / Assertx.cs
Last active November 11, 2023 04:44
C# unit testing helper methods for MSTest
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
namespace UnitTests
{
/// <summary>
@radj307
radj307 / CMakePresets.json
Created August 8, 2022 01:54
Default Visual Studio 2022 CMakePresets.json ("version": 3)
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
@radj307
radj307 / PublishNuget.yml
Last active April 27, 2022 22:11
GHActions Scripts for `dotnet`
name: Publish Nuget Package
on:
workflow_run:
workflows: [Update Version]
types:
- completed
defaults:
run:
@radj307
radj307 / Synthesis.svg
Last active March 2, 2024 10:07
Mutagen Synthesis shields.io endpoint
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@radj307
radj307 / GenerateRelease-csharp.yml
Last active February 24, 2023 21:01
Github Actions Scripts from Volume Control
name: Generate Release
on:
workflow_run:
workflows:
- 'Update Version'
types:
- 'completed'
defaults:
@radj307
radj307 / description.md
Last active February 26, 2022 18:14
Custom shields.io endpoint for static github shield

Github Logo Shield

Example
Custom badge

Raw HTML <img alt="Custom badge" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fradj307%2F7d834b1d20c178d4067246fc4e7af9d7%2Fraw%2Fd3a2e19a2a9ac52bd974bcfc92a38cc7d8ee7c68%2Fendpoint.json">

@radj307
radj307 / description.md
Last active January 11, 2026 10:22
Custom shields.io Endpoint for nexusmods.com

Nexus Mods Shield

This is a custom endpoint for shields.io that you can use for whatever you want.
It displays the nexusmods icon in one of the available styles.

Examples of various styles

  • &style=plastic

      Custom badge