Skip to content

Instantly share code, notes, and snippets.

View Magnuti's full-sized avatar

Magnuti

  • Trondheim, Norway
View GitHub Profile
@Magnuti
Magnuti / csharp_nswag.md
Created November 12, 2024 09:48
C# client generation from Swagger specification with NSwag on Docker

C# client generation from Swagger specification with NSwag on Docker

FROM mcr.microsoft.com/dotnet/sdk:8.0

# Install Node.js
RUN apt-get update -yq && apt-get upgrade -yq && apt-get install -yq curl
# We use Node.js 20 here, pick another version if you like that
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -yq nodejs build-essential
@Magnuti
Magnuti / .zshrc
Created March 7, 2024 14:34
Useful .zshrc stuff
# Command for terminating process on a port number
# $ kill_on_port <port_number>
function kill_on_port() {
if [ $# -eq 0 ]
then
echo "Please provide a port number"
return
fi
if [ -z "$1" ]
@Magnuti
Magnuti / zshrc.md
Last active February 2, 2024 08:29
.zshrc profile for Git autocompletion and branch name

Git autocompletion and Git branch name in Z shell prompt

autoload -Uz compinit && compinit

function parse_git_branch() {
    git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}

COLOR_GIT=$'%F{39}'
@Magnuti
Magnuti / posh_git_installation.md
Last active January 18, 2022 20:33
PoshGit installation
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
Add-PoshGitToProfile -AllHosts
@Magnuti
Magnuti / .gitconfig
Last active December 20, 2023 15:35
Global .gitconfig file
[alias]
st = status
[push]
autosetupremote = true
# Fixes contrasts issues on Powershell terminals with blue background
[color "status"]
changed = red bold
untracked = red bold
added = green bold