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 | |
$queries = DB::getQueryLog(); | |
$last_query = end($queries); |
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
*~ | |
.DS_Store | |
*.bak | |
*.swp | |
Thumbs.db | |
wp-config.php | |
wp-content/uploads/ | |
wp-content/blogs.dir/ | |
wp-content/upgrade/ | |
wp-content/backup-db/ |
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
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--restrict-file-names=windows \ | |
--domains website.org \ | |
--no-parent \ | |
www.website.org/tutorials/html/ |
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 | |
/** | |
* Include a local settings file if it exists. | |
*/ | |
$local_settings = dirname(__FILE__) . '/settings.local.php'; | |
if (file_exists($local_settings)) { | |
include $local_settings; | |
} |
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 | |
$to = "[email protected]"; | |
$subject = "Hi!"; | |
$body = "Hi,\n\nHow are you?"; | |
$headers = "From: [email protected]\r\n" . | |
"X-Mailer: php"; | |
if (mail($to, $subject, $body, $headers)) { | |
echo("<p>Message sent!</p>"); | |
} else { | |
echo("<p>Message delivery failed...</p>"); |
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
# Checkout branch for tracking old school. | |
git checkout --track -b dev origin/dev | |
# Undo local commits | |
git reset --hard | |
# Tag your release version and push it remote | |
git tag -a release-1.0 -m "Creating the first official version." | |
git push --tags origin master |
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
# Remove all .svn folders | |
rm -rf `find . -type d -name .svn` |
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
# Add a user | |
adduser USERNAME | |
# Set primary group | |
usermod -g www-data USERNAME | |
# Create ssh key | |
ssh-keygen -t rsa -C "[email protected]" | |
# Create HTTP password protection |
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 | |
/** | |
* Implements hook_form_alter(). | |
*/ | |
function MODULE_form_user_login_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state) { | |
// Allow login with email. | |
array_unshift($form['#validate'], 'MODULE_user_login_form_validate'); | |
// Change the field label. | |
$form['name']['#title'] = new \Drupal\Core\StringTranslation\TranslatableMarkup('Email or Username'); |
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
{ | |
"name": "CLIENT/SITE", | |
"description": "Custom Wordpress site using Tendril.", | |
"repositories":[ | |
{ | |
"type":"composer", | |
"url":"https://wpackagist.org" | |
} | |
], | |
"require": { |