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
Source: https://www.bluespark.com/blog/uninstalling-and-purging-field-modules-all-once | |
The job is divided in three parts: The data definition, field data purge and module list clean. | |
In the data definition task we provide all the required data we need to perform the task, the name of the field to delete, and given that | |
information, we get the field_info array and the name of the module to be uninstalled. Finally, field_delete_field() is executed. | |
After that the field data is purged in the batch body, and since we don't know how much data we will have to purge, we remove just 100 | |
database rows per batch execution. After each purge we check if all the data has been removed to decide if we have to remove more data | |
from the database or continue to the final part. |
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
<!DOCTYPE html> | |
<html<?php print $html_attributes; ?>> | |
<head> | |
<?php print $head; ?> | |
<title><?php print $head_title; ?></title> | |
<?php print $styles; ?> | |
<?php print $head_scripts; ?> | |
</head> | |
<body<?php print $body_attributes;?>> |
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
#!/bin/bash | |
# Get project directory and git url | |
echo "Project code (used for project directory name):" | |
read project_code | |
echo "Project repo git url (can be blank):" | |
read project_git_url | |
# Clone DrupalVM | |
git clone git@github.com:geerlingguy/drupal-vm.git $project_code |
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
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`) | |
VALUES ('newadminname', MD5('somerandomstrongpassword'), 'firstname lastname', 'email@domain.com', '0'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10'); |
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 | |
* Creates a compressed zip file. | |
* | |
* @author Original Author: David Walsh | |
* @author Modified by: Nick Mathew | |
* @link https://davidwalsh.name/create-zip-php | |
*/ |
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 | |
* Download helper to download files in chunks and save it. | |
* | |
* @author Syed I.R | |
* @author Modified by: Nick Mathew | |
* @link https://github.com/irazasyed | |
*/ |
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 | |
* drushrc.php | |
*/ | |
/** | |
* Open link in specific browser. | |
* |
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 | |
fix_file_directory_permission(dirname(__FILE__)); | |
function fix_file_directory_permission($dir, $nomask = array('.', '..')) { | |
if (is_dir($dir)) { | |
// Try to fix directories permission | |
if (@chmod($dir, 0755)) { | |
echo "<p>Permission Fixed for : " . $dir . "</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
Create a QR code with any QR generator in this format: | |
WIFI:S:<ssid>;T:<wpa|wep|>;P:<password>;; | |
Scanning this code will automatically add the WiFi details to the device. [1][2] | |
iOS will share the username and password. To prevent that, create a configuration file using | |
the iPhone configuration utility and have the QR code link to that file. This file can be on | |
Dropbox or any other server. [3] |
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
find . -name "*.sass" | xargs git add |