Skip to content

Instantly share code, notes, and snippets.

View atruskie's full-sized avatar
🤨

Anthony Truskinger atruskie

🤨
View GitHub Profile
@atruskie
atruskie / Update-AUPackages.md
Last active March 28, 2024 08:06
Update-AUPackages Report #powershell #chocolatey
@atruskie
atruskie / VisualStudioAttacher.cs
Last active November 20, 2023 14:55
A class for programmatically attaching Visual Studio to debug a process. It can be used to automatically attach Visual Studio to your process. It can dynamically attach any solution to any process.
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AutoAttachVs.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>
// <summary>
// Example taken from this gist.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
#if DEBUG
@atruskie
atruskie / AbstractNodeNodeTypeResolver.cs
Last active May 11, 2023 03:07
Inferring abstract/interface types for YamlDotNet Deserialization
using System;
using System.Collections.Generic;
using System.Linq;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NodeDeserializers;
namespace Egret.Cli.Models
{
@atruskie
atruskie / terminal-keybind.ahk
Last active December 30, 2022 15:44
AutoHotkey script to bind Win+~ keyboard shortcut to Windows Terminal
#NoEnv
#SingleInstance force
SendMode Input
DetectHiddenWindows, on
SetWinDelay, 0
#`::
terminal := WinExist("ahk_exe WindowsTerminal.exe")
if (terminal)
{
@atruskie
atruskie / Program.cs
Last active January 12, 2022 08:27
System.Drawing and SkiaSharp - fill blending via opacity channel for rgb (no alpha) image
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Drawing.Processing;
using SixLabors.ImageSharp.Processing;
using SkiaSharp;
using System;
using System.IO;
namespace ConsoleApp1
@atruskie
atruskie / Program.cs
Created April 14, 2020 01:17
Test ImageSharp pixel blending
using System;
using System.IO;
using SixLabors.Fonts;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using Color = SixLabors.ImageSharp.Color;
using Pen = SixLabors.ImageSharp.Processing.Pen;
namespace ImageSharpTests
@atruskie
atruskie / test.md
Created April 7, 2020 06:12
hard line break

Hello I am a single paragraph

I am another paragraph. There are no line breaks in me.

@atruskie
atruskie / template_strings.ts
Created January 22, 2020 04:16
Typescript: strongly typed, lazy evaluated, interpolated strings
let id = (x: number) => x;
let param = (x: string) => x;
type ParamType<T> = T extends (arg: infer R) => any ? R : never;
/**
* Templates a string by substituting placeholders for tokens later in execution.
* It is designed to work as the tag function for tagged interpolated strings.
* @returns A reusable template function that is statically checked for arity and
@atruskie
atruskie / complex_postres_query_template.sql
Created February 15, 2016 01:17
A template/pattern (that I commonly use) for creating complex PostgreSQL queries
/*
* This is a template for creating very complex PostgreSQL queries.
* Large queries quickly become very unreadable because variables and
* other snippets of code cannot be refactored out. This template demos
* using variables within an anonymous PL/pgSQL block and returning the
* table result, WITHOUT requiring write permission to the database!
* The use of variables are trivial within this example.
*/
DO $$
@atruskie
atruskie / gist:91c299114038254cb88eb52f19e49352
Created April 11, 2019 11:43
Chocolatey Packages Statuses (Test)
empty