Skip to content

Instantly share code, notes, and snippets.

View leonlaser's full-sized avatar
🍪

Leon Dietsch leonlaser

🍪
View GitHub Profile
@leonlaser
leonlaser / easing.js
Created July 5, 2021 11:50 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
@leonlaser
leonlaser / clear_index.sh
Created July 15, 2021 07:59
[Clear spotlight index] #shell #macos #spotlight #index
sudo mdutil -avE
@leonlaser
leonlaser / add to firewall
Created March 3, 2023 12:17
[Add application to macos firewall] #macos #firewall
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add application
@leonlaser
leonlaser / angular-material-cdk-placeholder-migration.md
Last active December 24, 2024 21:41
Regular expression to migration Angular Material form inputs from `placeholder` attribute to `<mat-label>` tags

Manual Angular Material/CDK placeholder migration

Why?

The removed "legacy" appearance promoted input placeholders to the floating label if the label was not specified. All newer appearance settings require explicitly specifying a if one was not provided before. This change addresses an accessibility best practice of not using labels and placeholders interchangeably.

Migrating to MDC-based Angular Material Components | Form Fields

How?

This regular expression works with IntelliJ IDE and maybe with others, supporting regex search and replace.