Skip to content

Instantly share code, notes, and snippets.

View mtrefzer's full-sized avatar

Michael Trefzer mtrefzer

  • Spain, San Miguel de Salinas
View GitHub Profile
@mtrefzer
mtrefzer / postbuild-purge-css.md
Last active November 12, 2021 09:57
Angular: Use PurgeCSS in postbuild script

Howto

Angular: Use PurgeCSS in a postbuild script

Install ts-node and purgecss as devDependencies

$ npm i -D purgecss
$ npm i -D ts-node
@mtrefzer
mtrefzer / git-use-feature-branch.md
Last active November 1, 2021 07:45
git-use-feature-branch

Howto

Git: use feature branch

Create Branch and push (code should never exist in just one place).

$ git checkout -b feature-branch main          // creates a local branch for the new feature
$ git push origin feature-branch               // makes the new feature remotely available

Howto

Git: client error, server certificate verification failed

Thanks to fabianlee.org Git: client error, server certificate verification failed

# Fetch certificate
openssl s_client -showcerts -servername git.mycompany.com -connect git.mycompany.com:443 </dev/null 2>/dev/null | sed -n -e '/BEGIN\ CERTIFICATE/,/END\ CERTIFICATE/ p'  > git-mycompany-com.pem

# Add certificate to local certificate list
@mtrefzer
mtrefzer / dump-db-mysql-docker.md
Last active August 16, 2021 10:17
Backup and restore a mysql database from a running Docker mysql container

Howto

Backup and restore database MySQL Docker container

# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql

# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@mtrefzer
mtrefzer / sudo-node-comand-not-found.md
Last active July 19, 2021 10:42
sudo node comand not found witn nvm

Howto

Fix sudo node comand not found using nvm

sudo ln -s /home/username/.nvm/versions/node/vx.y.z/bin/node /usr/local/bin/