Skip to content

Instantly share code, notes, and snippets.

View zlrc's full-sized avatar
🐇✨

Mike K. zlrc

🐇✨
View GitHub Profile
@zlrc
zlrc / git-backup.ini
Last active June 9, 2024 07:28
Git command aliases for backing up uncommitted changes to a new branch.
[alias]
# Creates a snapshot of the current working tree state and saves it to a new branch.
backup = "!f() { \
BACKUP_SOURCE_BRANCH=$(git symbolic-ref --short HEAD) \
&& BACKUP_TARGET_BRANCH=backup/$BACKUP_SOURCE_BRANCH-$(date +%Y_%m_%d_%H%M%S) \
&& git checkout -b $BACKUP_TARGET_BRANCH \
&& (git commit --no-verify --allow-empty -m \"Index (Staged Changes)\" \
&& git add -A \
&& git commit --no-verify --allow-empty -m \"Working Tree (Unstaged and Untracked)\" \
&& git checkout --detach HEAD \
@zlrc
zlrc / nextwallpaper.ahk
Last active April 22, 2024 02:06
An AutoHotkey v2 script for Windows 10 that advances a wallpaper slideshow to the next background. This automates right-clicking the desktop and selecting "Next desktop background" from the context menu.
; This script advances the wallpaper slideshow to the next image. Requires AutoHotkey v2.
; Author: Mike "ZiRC" K. (https://github.com/zlrc)
; License: CC0 (https://creativecommons.org/publicdomain/zero/1.0/)
;
; Relevant AutoHotkey Documentation:
; - ComObject: https://www.autohotkey.com/docs/v2/lib/ComObject.htm
; - ComValue: https://www.autohotkey.com/docs/v2/lib/ComValue.htm
; - ComCall: https://www.autohotkey.com/docs/v2/lib/ComCall.htm
; - DllCall: https://www.autohotkey.com/docs/v2/lib/DllCall.htm
@zlrc
zlrc / TextureCollisionPoly2D.gd
Last active November 21, 2022 03:12
A Godot Engine class that combines the CollisionPolygon2D and Polygon2D nodes together to allow textured collision polygons.
# A CollisionPolygon2D node that supports textures and other Polygon2D-exclusive features.
# Compatible with Godot version 3.x
# Script Version: 0.1.0
# Note(s):
# - For textures to appear in the editor, you must either reload the scene,
# or drag one of the vertices after the collision polygon has been drawn.
# - At the moment, the only way to hide collision boxes in the editor is to
# set the self_modulate opacity (alpha) to 0.
###############################################################################
# Copyright (c) 2022 Mike K. (https://github.com/zlrc) #
@zlrc
zlrc / electric_potential.glsl
Last active November 22, 2023 00:48
Configurable fragment shader for drawing equipotential lines. Demo: https://www.shadertoy.com/view/NlVfRD
// Electric Potential-inspired Fragment Shader
// Author: Mike "ZiRC" K.
// Demo: https://www.shadertoy.com/view/NlVfRD
//
// Works off of "Contour lines" by 8x as a starting point (most of the original code has been modified):
// https://www.shadertoy.com/view/lltBWM
//
// This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
// Information about the license can be found here: http://creativecommons.org/licenses/by-nc-sa/4.0/
#version 300 es