Skip to content

Instantly share code, notes, and snippets.

View TonyVlcek's full-sized avatar

Tony TonyVlcek

View GitHub Profile
@TonyVlcek
TonyVlcek / Nette @inject Live Template for PhpStorm
Last active September 28, 2019 18:17
Nette @Inject Live Template for PhpStorm
This Live Template makes creating new @inject properties super quick and easy.
See the images below to get the idea of how it works and how to set it up.
Read more about Live Templates in PhpStorm here: https://www.jetbrains.com/help/phpstorm/using-live-templates.html
@TonyVlcek
TonyVlcek / find-and-resize-images.bash
Created February 19, 2019 18:13
Find and shrink images of given name and size constraint. Run it in a very low priority mode.
nice -n 20 sh -c 'find -name "IMG_00.jpg" -size +1M | xargs mogrify -resize 600x'
@TonyVlcek
TonyVlcek / all-to-mailinator.sql
Created October 5, 2018 10:15
On staging or local environment you typically want to have real data for testing but you want to make sure not to send out test messages to real clients. By running this snippet all the client's email addresses will be predictably transformed to @mailinator.com public addresses.
UPDATE client SET email = CONCAT(REPLACE(email, '@', '-'), '@mailinator.com');
@TonyVlcek
TonyVlcek / clone-remote-db.sh
Created September 13, 2018 23:27
Simple script for mirroring a remote mysql database on local.
#!/bin/bash
REMOTE_NAME='name'
REMOTE_PASS='pass'
REMOTE_HOST='host'
REMOTE_DB='db'
LOCAL_NAME='name'
LOCAL_PASS='pass'
@TonyVlcek
TonyVlcek / trumbowyg-fontawesome-icons.css
Last active June 1, 2020 07:35
FontAwesome icons for Trumbowyg
.trumbowyg-viewHTML-button:after {
font-family: FontAwesome;
content: "\f121";
}
.trumbowyg-undo-button:after {
font-family: FontAwesome;
content: "\f0e2";
}