Skip to content

Instantly share code, notes, and snippets.

View etiennemarais's full-sized avatar
🇿🇦
...

Etienne Marais etiennemarais

🇿🇦
...
View GitHub Profile
@etiennemarais
etiennemarais / adding better timeout for composer
Last active September 27, 2017 11:09
Notes about advanced composer
COMPOSER_TIMEOUT=600 php -d memory_limit=2G path/to/composer.phar $@
@etiennemarais
etiennemarais / gist.sh
Last active October 26, 2017 10:33
Compressing a big folder and wanting progress
sudo su
tar cf - <folder> -P | pv -s $(du -sb <folder> | awk '{print $1}') | gzip > data.tar.gz
# Outputs something like this
# 3.06GiB 0:03:01 [15.8MiB/s] [========> ] 5% ETA 0:57:05
#
# I recently needed to perform a data recovery on a bad migration where I deleted the wrong stuff. I tried to recover data
# from a mysql 5.5 dump to a mysql 5.7 ubuntu 16.04 google cloud box and even though I could edit the data and fix the deleted
# rows in the tables, I coulnd't export it well enough since incompatibilities between 5.5 and 5.7 :(
@etiennemarais
etiennemarais / logslaravel.sh
Last active September 17, 2018 11:24 — forked from jakebathman/logslaravel.sh
Tail Laravel logs and filter out the stack traces
tail -f -n 450 laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
[alias]
# Git Commit, Add all and Push — in one step.
cap = "!f() { git add .; git commit -m \"$@\"; }; f"
# NEW.
new = "!f() { git cap \"📦 NEW: $@\"; }; f"
# IMPROVE.
imp = "!f() { git cap \"👌 IMPROVE: $@\"; }; f"
# FIX.
fix = "!f() { git cap \"🐛 FIX: $@\"; }; f"