Skip to content

Instantly share code, notes, and snippets.

View karimkod's full-sized avatar
⌨️
*Keyboard clicks*

Bourennane Abdelkrim karimkod

⌨️
*Keyboard clicks*
View GitHub Profile
@karimkod
karimkod / Result.cs
Created November 20, 2024 21:32
A simple C# implementation of a Result Pattern
using System;
using System.Threading.Tasks;
namespace Rbit.Application.Common;
public class Result<TValue, TError> : IHaveError<TError>
{
public TValue? Value { get; }
public TError? Error { get; }
@karimkod
karimkod / clear-local-branches.ps1
Created November 26, 2024 09:34
A Powershell command to remove local git branches that don't have a matching remote branch.
git fetch -p && git branch -vv | Select-String -Raw "gone" | %{ git branch -D ($_.Split(" ")[2])}