sudo nano /etc/mysql/my.cnf
- Add the following lines at the end:
[mysqld] skip-grant-tables
sudo service mysql restart
mysql -u root
UPDATE mysql.user set authentication_string = PASSWORD('your_new_password') where user = 'root' and host = 'localhost';
exit
- Remove the lines added in step 2 if you want to keep your security standards.
This file contains 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 | |
# This function requires: | |
# - GNU sed (brew install gnu-sed) | |
# - Homebrew-managed PHP versions (e.g. brew install php@8.0) | |
# - The project_php_version function (https://gist.github.com/DieterHolvoet/49e1677e3ba0a7fd813fbbd92a7df70d) | |
function xdebug_mode() { | |
if [[ "$1" == "-h" ]]; then | |
echo "Get or set the xdebug.mode option for the current project's PHP version. Call without argument to get the current value, call with an argument to change it." |
This file contains 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 | |
namespace Drush\Commands; | |
use Drupal\Core\Database\Database; | |
use Drupal\Core\Queue\DelayableQueueInterface; | |
use Drupal\Core\Queue\DelayedRequeueException; | |
use Drupal\Core\Queue\RequeueException; | |
use Drupal\Core\Queue\SuspendQueueException; | |
use Drush\Drush; |
This file contains 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 | |
# Run php_install_valet once to set up your environment. | |
# This can be used in combination with https://gist.github.com/DieterHolvoet/49e1677e3ba0a7fd813fbbd92a7df70d: | |
# function switch_php_version() { | |
# switch_php_version_valet $1 | |
# } | |
# These functions require GNU sed: |
This file contains 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
# The jq command is required to run this script. Install using 'brew install jq' | |
# Add the following script yourself, choosing the switching method that works for you: | |
# function switch_php_version() { | |
# # switch_php_version_brew $1 | |
# # switch_php_version_cli_brew $1 | |
# # switch_php_version_cli_mamp $1 | |
# } | |
# If you're using zsh, include this to automatically switch on cd: |
This file contains 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 | |
# Include this in your shell configuration file (.bashrc, .bash_profile, .zshrc, ...) | |
# The jq command is required to run this script. Install using 'brew install jq' | |
if ! type "composer" > /dev/null; then | |
brew install composer | |
fi | |
mkdir -p /usr/local/bin/ |
This file contains 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
/* Get file extension of document */ | |
Document.prototype.getFileExtension = function() { | |
var str = this.fullName.fsName; | |
return str.substring(str.lastIndexOf(".") + 1); | |
}; |
This file contains 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
/* Return the corresponding Document object of a given File object, and open the file if necessary. */ | |
File.prototype.asDocument = function() { | |
var document = false; | |
for(var i = 0; i < app.documents.length; i++) { | |
if(app.documents[i].getFullPath() === this.getFullPath()) { | |
$.writeln("Found at index " + i + " => " + this.getFullPath()); | |
document = app.documents[i]; | |
break; | |
} |