Skip to content

Instantly share code, notes, and snippets.

View AldeRoberge's full-sized avatar
💛
.

Alexandre D. Roberge AldeRoberge

💛
.
View GitHub Profile
@AldeRoberge
AldeRoberge / MovIntegrityChecker.cs
Created October 15, 2025 13:12
MOV File Integrity Checker reads the last bytes of a .mov file and outputs error results. Useful for partially transferred files.
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.Linq;
public class MovIntegrityChecker
{
// Common MOV/MP4 atom types
private static readonly HashSet<string> ValidAtomTypes = new HashSet<string>
@AldeRoberge
AldeRoberge / github-issues-labels.md
Created October 9, 2025 20:23
A list of labels for issues in GitHub that might be useful. Inspired by Electron's way to label issues.

🐛 Bug & Error

Emoji Label Description
🐞 bug :beetle: General functional issue.
🔁 bug/regression :arrows_counterclockwise: Something that used to work, but doesn’t anymore.
💥 crash :boom: Causes the app to crash.

🪟 Platforms

| Emoji | Label | Description |

@AldeRoberge
AldeRoberge / AvatarCreateService.cs
Created October 2, 2025 15:03
Create images using Stable Diffusion API from C#
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
namespace SimpleAvatarGenerator
{
/// <summary>
@AldeRoberge
AldeRoberge / batchInvertColorPhotoshopScript.jsx
Created September 29, 2025 23:23
batchInvertColorPhotoshopScript.jsx
#target photoshop
// Ask the user to select a folder
var inputFolder = Folder.selectDialog("Select the folder containing PNG files to invert");
// Check if the user selected a folder
if (inputFolder != null) {
// Get all the PNG files in the selected folder
var pngFiles = inputFolder.getFiles("*.png");
@AldeRoberge
AldeRoberge / useful-ubuntu-tips.md
Created September 22, 2025 19:16
Useful Ubuntu Tips

Useful Ubuntu Tips

1. Check Open Ports

To see which ports are being used by your server:

sudo ss -tulnp
@AldeRoberge
AldeRoberge / ScaleOfThingsThatHappen.md
Created September 22, 2025 19:15
Scale of Things That Happen (or don't)

Scale of Things That Happen, from impossible fiction to real-life history.

Scale Description Examples
Impossible / Fictional Future Events or worlds that could never exist or are purely imagined. ???
Made-Up / Creative Fiction Imagined, but internally consistent within a story or game. Could exist in a fictional universe. Magical schools, dystopian societies, alternate history novels, role-playing game quests
Possible / Speculative Could happen, but hasn’t yet; relies on current science or trends. Colonizing Mars, AI achieving general intelligence, futuristic technology prototypes
Real-Life / Current Things that are actually happening today in the real world. Everyday events
Concrete History / Past Events that actually happened and are documented in history. World War II
@AldeRoberge
AldeRoberge / BackgroundScaler.cs
Created September 18, 2025 20:22
Scale a unity background to full size in portrait mode, and take about 1/3rd in landscape mode
using Sirenix.OdinInspector;
using UnityEngine;
namespace ADG.Scripts.Runtime
{
[ExecuteAlways]
[RequireComponent(typeof(RectTransform))]
public class BackgroundScaler : MonoBehaviour
{
[SerializeField, Required, BoxGroup("References")]
@AldeRoberge
AldeRoberge / gist:2f982d6869045e99133358bffa951395
Created July 10, 2025 15:06
Fixing a .NET Aspire Project Not Being Pushed to Docker

🧪 Debugging Missing Project in .NET Aspire Publish

While working with .NET Aspire, I encountered an issue where one of my projects (adg-banner-printer) wasn’t being included in the aspire publish process. Here's a breakdown of the troubleshooting steps and the root cause:

  1. Internal Program Class? I initially suspected the issue might be due to the Program class being marked as internal. That wasn’t the case.

  2. Private Main Method? Next, I checked whether the Main method being private might be the cause. Still no effect.

@AldeRoberge
AldeRoberge / Secret.cs
Created July 4, 2025 13:27
Secrets easy management, uses Ardalis.SmartEnum, FluentValidation, Levenshtein Distance, to provide help in getting secrets.
using Ardalis.SmartEnum;
using FluentResults;
namespace ADG.Server.Shared.Secrets;
public class Secret : SmartEnum<Secret, string>
{
public static readonly Secret OpenAI_ApiKey = new(nameof(OpenAI_ApiKey), "OPEN_AI_API_KEY");
public static readonly Secret ElevenLabs_ApiKey = new(nameof(ElevenLabs_ApiKey), "ELEVEN_LABS_API_KEY");
@AldeRoberge
AldeRoberge / DateTimeTestingExtensions.cs
Created June 29, 2025 02:32
Adds Shouldly shoulds for DateTime.
using Shouldly;
namespace ADG.Server.AppHost.Tests.Utilities;
public static class DateTimeTestingExtensions
{
public static void ShouldBeAfter(this DateTime actual, DateTime expected)
{
if (actual <= expected)
throw new ShouldAssertException($"Expected {actual} to be after {expected}");