Skip to content

Instantly share code, notes, and snippets.

View bruchmann's full-sized avatar
🏠
Pining for the Fjords

Steffen Bruchmann bruchmann

🏠
Pining for the Fjords
View GitHub Profile
@viniciusemferreira
viniciusemferreira / velocity_component.gd
Last active May 2, 2025 18:50
A Godot (GDScript) velocity component for handling movement, acceleration, knockback effects, and deceleration, designed for use with a `CharacterBody2D`.
extends Node2D
class_name VelocityComponent
## The maximum speed this object can move at.
@export var max_speed: float = 100
## The rate of acceleration used when applying knockback.
@export var knockback_acceleration: float = 15
## The rate of acceleration when moving normally.
class_name CallableStateMachine
var state_dictionary = {}
var current_state: String
func add_states(
normal_state_callable: Callable,
enter_state_callable: Callable,
leave_state_callable: Callable
@khalidx
khalidx / node-typescript-esm.md
Last active April 15, 2025 14:15
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@meloonics
meloonics / PolygonSnappingArea2D
Created June 20, 2022 15:01
Script for Area2D to wrap its CollisionPolygon2D around a given Polygon2D
#######################################################################################
# ~~~~~~~~ Polygon-Snapping Area2D - written by meloonics in Godot 3.4, 2022 ~~~~~~~~ #
# HOW TO USE: #
# 1. Make a scene which has Area2D as root and a CollisionPolygon2D as child. #
# Call it whatever, but don't rename the CollisionPolygon2D. #
# 2. Attach this script to the root. #
# 3. Add the scene as child to either Polygon2D or CollisionPolygon2D. Won't work otherwise, no idea why you think it would smh my head
# 4. Adjust offset, distance and thickness to your liking. #
# The CollisionShape of the Area2D should update automatically. #
# 5. Don't overdo it with the thickness in concave shapes, or the polygon will break #
@Yarith
Yarith / Article - Animate removed DOM elements.md
Last active April 28, 2022 23:50
Elm: Animate the removal of DOM elements with CustomElement and MutationObserver

Elm: Animate the removal of DOM elements with CustomElement and MutationObserver

Desired result

You can see the end result in this ellie. It displays a smooth removal of the clicked items. You can also remove some items from the beginning or the end.

Version 1

https://ellie-app.com/cvCV93KgD56a1

Version 2

An updated ellie with improved performance. This gist was not yet updated with all changes made in this version. Only the article text is somewhat updated.

@wdkrnls
wdkrnls / wallpaper.sh
Created January 5, 2018 03:48
Set wallpaper independently for each tag in herbstluftwm
#!/bin/bash
# This code was modified from Thorsten by me:
# https://bbs.archlinux.org/viewtopic.php?pid=1024618#p1024618
# sets a tag defined wallpaper when tag changes
declare -A WALLPAPER
# These wallpapers come with Deepin desktop environment, but also look great in hlwm
DIR=/usr/share/backgrounds
@romainl
romainl / headings.vim
Created September 23, 2017 13:50
Markdown : jump to next heading
" markdown : jump to next heading
function! s:JumpToNextHeading(direction, count)
let col = col(".")
silent execute a:direction == "up" ? '?^#' : '/^#'
if a:count > 1
silent execute "normal! " . repeat("n", a:direction == "up" && col != 1 ? a:count : a:count - 1)
endif
@romainl
romainl / vanilla-linter.md
Last active April 20, 2025 07:00
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.

@alirobe
alirobe / reclaimWindows10.ps1
Last active May 30, 2025 23:55
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security