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 | |
/** | |
* Script to non-recursevly rename files in the directory where the script is. | |
* TODO: | |
* - Provide help flag (option -h or -help) | |
* - Check special characters | |
*/ | |
// Search and replace parameters |
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 7.1 | |
valet stop && brew services stop php56 && brew unlink php56 && brew link php71 && brew services start php71 && valet start | |
valet stop && brew unlink php56 && brew link php71 && brew services start php71 && valet start | |
PHP 5.6 | |
valet stop && brew services stop php71 && brew unlink php71 && brew link php56 && brew services start php56 && valet start | |
valet stop && brew unlink php71 && brew link php56 && brew services start php56 && valet start |
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 | |
$databases['default']['default'] = array ( | |
'database' => '', | |
'username' => '', | |
'password' => '', | |
'host' => 'localhost', | |
'port' => '3306', | |
'driver' => 'mysql', | |
'prefix' => '', |
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 | |
$num_updated = db_update('users') | |
->fields(array( | |
'timezone' => 'America/Phoenix', | |
)) | |
->execute(); | |
drupal_set_message(t('@var users where updated.', array('@var' => $num_updated)), 'status'); |
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 | |
$query = new EntityFieldQuery(); | |
$query->entityCondition('entity_type', 'user', '='); | |
$query->propertyCondition('mail', NULL); | |
$query->propertyCondition('uid', 0, '>'); | |
$query_result = $query->execute(); | |
if (isset($query_result['user'])) { |
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 | |
$users = array( | |
'username1', | |
'username2', | |
); | |
foreach ($users as $username) { | |
$user = user_load_by_name($username); | |
$role = user_role_load_by_name("event coordinator"); |
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 "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))" |
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 | |
class rectangle { | |
public function __construct($size, $width = 0, $height = 0) { | |
$sizes = $this->getSizes(); | |
if (isset($sizes[$size])) { | |
$this->width = $sizes[$size]['width']; | |
$this->height = $sizes[$size]['height']; |
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: research-academy | |
recipe: drupal7 | |
config: | |
webroot: . | |
php: '5.6' | |
xdebug: true | |
services: | |
appserver: | |
build: | |
- "mkdir -p ~/.drush/site-aliases" |
OlderNewer