SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = "$DB_NAME"
AND table_name = "$TABLE_NAME"
ORDER BY ROUND(((data_length + index_length) / 1024 / 1024), 2) DESC;
-- or this query to list the size of every table in every database, largest first:
- usefull vagrant plugins
vagrant plugin install vagrant-vbguest vagrant-bindfs vagrant-hostsupdater
- update after.sh
# after.sh
git config --global user.email [email protected]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
USER=homestead | |
PASSWORD=secret | |
DATABASE=database | |
DB_FILE=/tmp/${DATABASE}.sql.gz | |
#dump specific table data | |
mysqldump --extended-insert --skip-lock-tables -u${USER} -p${PASSWORD} ${DATABASE} | gzip > ${DB_FILE} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#extract phar | |
phar extract -f php_util.phar extracted | |
#how to check is in phar | |
#if (strpos(__DIR__, 'phar://') === 0) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -e 'BEGIN{$/=\32768}' -pe "s/a/b/g" < one-line-250-mb.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PASSWORD=password | |
USER=user | |
DATABASE=database | |
DB_FILE=/tmp/${DATABASE}.sql.gz | |
EXCLUDED_TABLES=( | |
table_1 | |
table_2 | |
table_3 |
To fix it, on your mac do:
emacs (or vim/vi/nano/etc) ~/.ssh/config
And then, write this:
Wide open nginx CORS configuration CORS is a W3C working standard that currently has decent (but inconsistent) implementions in Firefox, Chrome and Safari. I use it primarily to test PhoneGap apps in regular browsers instead of testing the code in simulators. PhoneGap apps can skip the usual origin checks via configuration, but running a PhoneGap app takes more setup - which make it harder for designers to work with the app. Running apps in simulators or on actual devices also takes al lot more time that just reloading a browser and this annoys me.
{% for label, flashes in app.session.flashbag.all %}
{% for flash in flashes %}
<div class="alert alert-{{ label }}">
{{ flash }}
</div>
{% endfor %}
{% endfor %}