Skip to content

Instantly share code, notes, and snippets.

View dhAlcojor's full-sized avatar

Daniel Hernández Alcojor dhAlcojor

  • Wizeline
  • Madrid, Spain
  • 05:33 (UTC +02:00)
View GitHub Profile
@etodd
etodd / util.gd
Created June 15, 2026 16:33
My GDScript utility functions
class_name Util
extends Node
## Call this function every frame to move the given value toward the target in
## a smooth, springy, FRAMERATE INDEPENDENT way, such that it will take
## "duration" to reach within 1% of the target.
##
## Credit: https://x.com/FreyaHolmer/status/1757836988495847568
static func smooth_toward(current: float, target: float, duration: float, delta: float) -> float:
return lerpf(current, target, 1.0 - pow(0.01, delta / duration))
@jacurtis
jacurtis / _spacing-helpers.scss
Last active April 21, 2025 02:28
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote