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
./vendor/bin/drush user:create newuser --mail="newuser@mail.com" --password="newpassword" | |
./vendor/bin/drush user-add-role "administrator" newuser |
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
``` | |
drush eval "\$module_data = \Drupal::config('core.extension')->get('module'); unset(\$module_data['bamboo_twig_loader']); \Drupal::configFactory()->getEditable('core.extension')->set('module', \$module_data)->save();" | |
``` |
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
SELECT value FROM key_value WHERE collection="system.schema" AND name = 'block'; | |
Then | |
drush updb |
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 | |
/* strpos that takes an array of values to match against a string note the stupid argument order (to match strpos) */ | |
function strpos_arr($haystack, $needle) { | |
if(!is_array($needle)) $needle = array($needle); | |
foreach($needle as $what) { | |
if(($pos = strpos($haystack, $what))!==false) return $pos; | |
} | |
return false; | |
} |
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
# ------------------------------------ | |
# Docker alias and function | |
# ------------------------------------ | |
# Get latest container ID | |
alias dl="docker ps -l -q" | |
# Get container process | |
alias dps="docker ps" |
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 | |
function as_blocks_button_render( $attributes, $context ) { | |
// Get the text of the button. | |
preg_match('/<a[\s]+([^>]+)>((?:.(?!\<\/a\>))*.)<\/a>/',$context, $match); | |
$return['buttonText'] = parse_url($match[2])['path']; | |
// Get the text of the url. | |
preg_match_all('/<a\s+(?:[^>]*?\s+)?href=(["\'])(.*?)\1/', $context, $matches, PREG_SET_ORDER, 0); | |
$return['url'] = $matches[0][2]; |
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
``` | |
./../vendor/bin/drush user:password admin "admin" | |
``` | |
And d'ont forget to check status of the admin user to `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
<?php | |
/** | |
* @file | |
* Form and Mail hooks. | |
* | |
* The contact form API disable to send email to an anonymous user. | |
* We need to override the form before it was displayed and | |
* before send the email get the value of the field email of the | |
* person that filled the form. |
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
Redirect 301 /home / |
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
use Symfony\Component\HttpFoundation\Request; | |
/** | |
* Create a zip file with excel contain the list of clubs. | |
* | |
* @param Request $request | |
* @param $the_response_excel_file | |
* @param $the_file_name | |
*/ | |
public function exportAction(Request $request, $the_response_excel_file, $the_file_name) |
NewerOlder