Skip to content

Instantly share code, notes, and snippets.

View lucasmodrich's full-sized avatar
:octocat:
Focusing

LM lucasmodrich

:octocat:
Focusing
  • Australia
  • 05:08 (UTC +10:00)
View GitHub Profile
@ThomasFrans
ThomasFrans / git-worktree.md
Last active July 22, 2025 17:03
A gentle introduction to Git worktree

A Gentle Introduction to Git Worktree

Git worktree has become a major part of how I use Git over the past year. Anytime I mention it somewhere however, I get reactions from people who have never heard about the feature. Others have heard about it, but don't know how exactly it works or why it's beneficial. That's why I decided to write a short tutorial/introduction on this awesome feature that is baked right into the very git you are already using. I hope this can help people discover worktrees and be a gentle introduction on how to get started using them.

What is Git worktree

Git worktree facilitates working with multiple branches. In a normal Git workflow, you can only ever have one branch checked out at a single time.

@duncansmart
duncansmart / Secure environment variables on windows.md
Last active January 7, 2025 04:01
Secure environment variables on windows

Encrypting

To create a DPAPI-encrypted environment variable run the following PowerShell:

[Environment]::SetEnvironmentVariable((Read-Host "Enter name"), (Read-Host "Enter value" -AsSecureString | ConvertFrom-SecureString), 'User')

And follow the prompts:

image

@dannberg
dannberg / obsidian-daily-note-template.txt
Last active August 4, 2025 14:27
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
---
created: <% tp.file.creation_date() %>
---
tags:: [[+Daily Notes]]
# <% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %>
<< [[Timestamps/<% tp.date.now("YYYY", -1) %>/<% tp.date.now("MM-MMMM", -1) %>/<% tp.date.now("YYYY-MM-DD-dddd", -1) %>|Yesterday]] | [[Timestamps/<% tp.date.now("YYYY", 1) %>/<% tp.date.now("MM-MMMM", 1) %>/<% tp.date.now("YYYY-MM-DD-dddd", 1) %>|Tomorrow]] >>
---
@dungsaga
dungsaga / reduce-size-of-a-WSL-virtual-disk.md
Last active April 17, 2025 04:35
reduce size of a WSL virtual disk

Reduce size with diskpart

You should run PowerShell as Administrator (otherwise diskpart won't be able to received the piped commands)

$vhdx_path = '%USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\ext4.vhdx'

@"
select vdisk file=$vhdx_path
compact vdisk
@nicknisi
nicknisi / new-worktree.sh
Created January 27, 2022 12:44
Create a new worktree, install dependencies, and run an initial build
#!/usr/bin/env bash
# This script should help facilitate setting up a new worktree, including:
# - creating a new worktree
# - installing dependencies
# - creating a new branch
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
@mavaddat
mavaddat / .bashrc
Last active April 15, 2025 04:33 — forked from glsorre/keychain.ps1
Windows git and Windows Subsystem for Linux will never prompt ssh passphrase again
# To avoid having to re-type the password for SSH
test -f /usr/bin/keychain && eval $(/usr/bin/keychain --eval --quiet id_rsa)
@jlollis
jlollis / README.md
Created May 3, 2021 17:32 — forked from AlinaNova21/README.md
Rancher 2.0, RKE, and some Raspberry Pi 3s

Kubernetes and Arm

Getting rke and Rancher setup to run kubernetes on arm is interesting. There is no official support yet via rancher, although there is interest and some work done towards those efforts. This is my attempt at getting a cluster of 3 Pis (2 3Bs and 1 3B+) provisioned and registered to a rancher 2 server.

Prep

I've successfully completed this both with Hypriot OS 1.9.0 and the arm64 builds https://github.com/DieterReuter/image-builder-rpi64 Both times I used the same basic cloud-init setup

@tomtom215
tomtom215 / docker-compose.yaml
Last active January 9, 2024 02:29
adguard+portainer+watchtower docker-compose raspberry pi4
version: '3.3'
services:
portainer:
container_name: portainer
restart: unless-stopped
ports:
- '9000:9000'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- /home/pi/docker/portainer:/data
@levibostian
levibostian / README.md
Last active July 29, 2025 23:52
Beginner guide to conventional commits.

You know that when you are writing code and you make a git commit to your code? You know that when you make a commit, you are asked to type a message for that commit, right?

Conventional commits are a set of rules to follow for what to type for your commit messages. For example, let's say that you add a new feature to your latest app where users can upload a photo for their profile. Instead of writing a commit message like this: Add feature so users can upload profile picture for profile, you would write a commit message like this: feat(profile): user can upload profile picture. Notice that when you read both messages, they both mean the same thing. However, they are written in 2 different formats. When you write your commit message in the later format, we call that a Conventional commit.

Why?

Conventional commits are becoming more popular today and for good reason. Conventional commits are not only more descriptive to read, but they are written in a format that a computer can understand better

@WillPresley
WillPresley / wsl-backup-and-compress.ps1
Last active April 17, 2025 04:33
Backup WSL2 Virtual Disks and Compress with 7-Zip
# Backup WSL2 virtual disks using native functions and compress them using 7zip
## Will Presley, 2020
## willpresley.com
#### http://mats.gardstad.se/matscodemix/2009/02/05/calling-7-zip-from-powershell/
# Alias for 7-zip
if (-not (test-path "$env:ProgramFiles\7-Zip\7z.exe")) {throw "$env:ProgramFiles\7-Zip\7z.exe needed"}
set-alias sz "$env:ProgramFiles\7-Zip\7z.exe"
#### Alternative native PS 7-zip: https://www.sans.org/blog/powershell-7-zip-module-versus-compress-archive-with-encryption/