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
| ## Check the size of database used by Drupal (MySQL is expected). | |
| drupal_db_name="$(drush sql-conf | grep "database" | grep -Eo "\S+$")" | |
| if [[ -z "$drupal_db_name" ]]; then | |
| echo "usage: run this command under a drupal instance directory." | |
| return | |
| fi | |
| $(drush sql-connect) -e "SELECT table_schema AS \"Database\", SUM(ROUND(((data_length + index_length) / 1024 / 1024), 2)) AS \"Size in MB\" FROM information_schema.TABLES WHERE table_schema = \"$drupal_db_name\"" |
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
| [user] | |
| name = me | |
| email = [email protected] | |
| [color] | |
| ui = auto | |
| [core] | |
| fileMode = false | |
| editor = code --wait | |
| excludesfile = ~/.gitignore | |
| [push] |
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
| # Bash completions. | |
| [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" | |
| # Set the default system editor. | |
| export EDITOR='code' | |
| # Set CLI color. | |
| export CLICOLOR=1 | |
| # Git prompt. |
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
| echo 'flush_all' | nc localhost 11211 |
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
| find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \; |
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
| cd /path/to/work/tree | |
| git --git-dir=/path/to/git/repo --work-tree=/path/to/work/tree checkout -f |
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
| <?php | |
| $my_date = strtotime($node->field_date[0]['value']); | |
| $tz_offset = strtotime(date("M d Y H:i:s")) - strtotime(gmdate("M d Y H:i:s")); | |
| $my_date += $tz_offset; | |
| print format_date($my_date, 'custom', 'D d F Y', NULL); | |
| ?> |