Skip to content

Instantly share code, notes, and snippets.

@svn-arc
svn-arc / PgArrayParser.cs
Last active August 16, 2025 23:33
Rough implementation of Postgres Replication in .NET
namespace Libraries.Replication;
public static class PgArrayParser
{
public static string?[] ParseStringArray(string pgArray)
{
if (string.IsNullOrWhiteSpace(pgArray) || pgArray == "{}")
return [];
var inner = pgArray.Trim().TrimStart('{').TrimEnd('}').Trim();
public static class DistributedCacheExtensions
{
public static Task SetAsync<T>(this IDistributedCache cache, string key, T value)
=> SetAsync(cache, key, value, new DistributedCacheEntryOptions());
public static Task SetAsync<T>(this IDistributedCache cache, string key, T value, DistributedCacheEntryOptions options)
{
var bytes = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(value, GetJsonSerializerOptions()));
return cache.SetAsync(key, bytes, options);
}
@svn-arc
svn-arc / semver.sh
Last active August 10, 2023 19:00
Semantic Versioning Script
#!/bin/bash
# Read the current version
currentVersion=$(cat version.txt)
# Get each part of the version number
major=$(echo $currentVersion | cut -d. -f1)
minor=$(echo $currentVersion | cut -d. -f2)
patch=$(echo $currentVersion | cut -d. -f3)
@svn-arc
svn-arc / fish_install.md
Created March 13, 2022 09:07 — forked from gagarine/fish_install.md
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1)

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager.

You can also download the fish app from their website. I do recomand using brew because update are easier.

Install Fish

@svn-arc
svn-arc / cshtml
Created September 23, 2021 14:03
Cover Note Design
@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}
@model GariPlatform.Domain.Entities.Policies.Policy
<!DOCTYPE html>
<html>
@svn-arc
svn-arc / GTWalsheimPro.md
Created August 15, 2021 20:57 — forked from mfd/GTWalsheimPro.css
GT Walsheim Pro

https://cdn.rawgit.com/mfd/7c7a915eb31474cc8c6a65066a4c4dc3/raw/f0f2fb94c21dea904812a53e0eb6cf0bc87f3754/GTWalsheimPro.css

<link rel="https://cdn.rawgit.com/mfd/7c7a915eb31474cc8c6a65066a4c4dc3/raw/f0f2fb94c21dea904812a53e0eb6cf0bc87f3754/GTWalsheimPro.css">