Skip to content

Instantly share code, notes, and snippets.

View KallDrexx's full-sized avatar

Matthew Shapiro KallDrexx

  • Microsoft
View GitHub Profile
@KallDrexx
KallDrexx / Microsoft.PowerShell_profile.ps1
Last active May 27, 2023 15:51
Personal Powershell Profile
Set-PSReadlineKeyHandler -Key Tab -Function Complete
Set-PSReadLineOption -BellStyle None
function Prompt() {
$pathParts = (Get-Location).Path -Split '\\'
$prompt = "PS "
if ($pathParts.Length -ge 1) {
$prompt += "$($pathParts[0])\"
}
@KallDrexx
KallDrexx / Tests.cs
Last active May 4, 2021 18:43
C# Create Instance Performance
using System;
using System.Reflection;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace Benchmarking
{
public class Program
{
public Program() { }
@KallDrexx
KallDrexx / msys2-SDL2-Setup.md
Created January 16, 2021 02:53 — forked from thales17/msys2-SDL2-Setup.md
msys2 sdl2 setup

Download and install msys2 64bit

Update msys2

  • Update msys2 64bit after install by running pacman -Syu if pacman needs to be updated you might have to close and reopen the terminal and run pacman -Syu again

Install build tools

  • pacman -S git mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_mixer mingw64/mingw-w64-x86_64-SDL2_image mingw64/mingw-w64-x86_64-SDL2_ttf mingw64/mingw-w64-x86_64-SDL2_net mingw64/mingw-w64-x86_64-cmake make

Compile Hello World

---------------------------
---------------------------
A plugin has had an error.
Shutting down the plugin Global ContentManager Helper Plugin version 1.0 at file location
C:\code\FlatRedBall\FlatRedBall\FRBDK\Glue\Glue\bin\x86\Debug\netcoreapp3.0\Plugins\OfficialPlugins\OfficialPluginsCore.dll
Additional information:
System.ArgumentException: Cannot check if a null file name is relative.
@KallDrexx
KallDrexx / EmitterLogic.cs
Last active August 14, 2020 13:35
Particle Emitter CodeGen example
using System;
using System.Numerics;
using Parme.CSharp;
public class Test : IEmitterLogic
{
private readonly Random _random = new Random();
private float _timeSinceLastTrigger;
@KallDrexx
KallDrexx / output.txt
Created December 8, 2019 14:52
AoC Day 8 Part 2
C:/Users/me/.cargo/bin/cargo.exe run --color=always --package aoc2019 --bin aoc2019
Compiling aoc2019 v0.1.0 (C:\code\personal\aoc2019)
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
Running `target\debug\aoc2019.exe`
[2, 1, 1, 0, 2, 1, 2, 2, 0, 1, 1, 1, 1, 0, 2, 0, 0, 2, 0, 2, 1, 0, 2, 2, 2, 0, 0, 2, 2, 0, 1, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 2, 0, 0, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 0, 2, 2, 2, 2, 0, 2, 0, 0, 1, 1, 2, 1, 0, 0, 1, 1, 1, 2, 1, 0, 1, 0, 2, 1, 1, 0, 0, 2, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 2, 1, 2, 0, 1, 0, 0, 2, 2, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 1, 1, 0, 1, 1, 2, 2, 0, 2, 0, 2, 1, 1, 1, 0, 0, 0, 1, 0, 0, 2, 0, 1, 1, 2]
[2, 2, 2, 2, 2, 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 0, 2, 2, 2, 1, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
@KallDrexx
KallDrexx / Program.cs
Last active December 2, 2019 16:46
Vtable benchmark
using System;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace VtableVsSwitchBenchmark
{
class Program
{
static void Main(string[] args)
@KallDrexx
KallDrexx / keybase.md
Created September 9, 2019 17:57
keybase.md

Keybase proof

I hereby claim:

  • I am kalldrexx on github.
  • I am kalldrexx (https://keybase.io/kalldrexx) on keybase.
  • I have a public key ASCRW-aqlFGs4R6g41rJlc4S4U8AdrIzlg7nYnfc1-6Viwo

To claim this, I am signing this object:

@KallDrexx
KallDrexx / Execution
Created December 27, 2016 04:40
Beam message passing latency testing
{:ok, tracker} = MessageTest.Tracker.start_link
Enum.each(1..1000, fn _ -> MessageTest.P1.start_link(tracker, 16, 1000) end)
iex(9)> MessageTest.Tracker.get_results(tracker, 99.9)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...]
public interface IStringReader
{
IEnumerable<string> GetStrings();
}
public class InMemoryStringReader : IStringReader
{
private readonly string[] _strings;
public InMemoryStringReader(string[] strings)