Skip to content

Instantly share code, notes, and snippets.

@Juan-escobar94
Juan-escobar94 / migrate-b4-to-b5.sh
Last active November 8, 2023 19:42
Migrate bootstrap 4 classes to bootstrap 5.
set -x
set -e
# e.g. folder to process e.g. "frontend/"
migration_folder=$1
find_regex=".*/*.tsx?" # mach all .ts and .tsx files
# include trailing path "/" in folder parameter: e.g "frontend/" instead of just "frontend"
ignore_path="*/$1node_modules/*"
# Back up your files or change sed argument -i to -i.bak to generate backup files
find $migration_folder -regextype posix-egrep -regex $find_regex -type f -not -path $ignore_path | xargs sed -i -E '/[(class)(")]/{
s/([mp])l(-[0-5])/\1s\2/g
@fdobrovolny
fdobrovolny / filter.py
Last active October 31, 2019 08:39
Pass multiple parametrs into Django filter
"""Pass multiple parametrs into Django filter.
Inspired by http://stackoverflow.com/a/24402622/2629036.
By this filters you can chain as many variables into parametrs as you like.
You can even make different lengths for one filter.
WARNING: You have to apply n_chain_end filter at the end of the n_chains.
Thanks to this the intial var can also be tupple.
@aallan
aallan / mac-vendor.txt
Last active March 27, 2024 16:58
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000003 XEROX CORPORATION
000004 XEROX CORPORATION
000005 XEROX CORPORATION
000006 XEROX CORPORATION
000007 XEROX CORPORATION
000008 XEROX CORPORATION
000009 powerpipes?