This file contains hidden or 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 | |
| /** | |
| * If you have a PHP Fatal error: Out of memory (allocated 147161088) (tried to allocate 42524112 bytes) in /wp-includes/wp-db.php on line 3042 | |
| * It's probably due to the preg_replace is still keep the memory used in previous process. | |
| * I added the code below to wp-db.php file and the problem is gone. But you have to hack the wordpress core code, which is not a good practice. | |
| */ | |
| for ($i = 0; $i < 4096; $i++) { | |
| preg_replace('/\d/', '', 1); |
This file contains hidden or 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 | |
| Payline\Settings::configure('https://api-test.payline.io', 'USr4EjVVrLxAAC2AGMezoMhQ', '2a788ff6-b6f8-4b19-a15f-6df8a3944c0f'); | |
| Payline\Bootstrap::init(); | |
| $identity = new \Payline\Resources\Identity(array("entity" => array( | |
| "business_type"=> "LIMITED_LIABILITY_COMPANY", | |
| "business_phone"=> "+1 (408) 756-4497", | |
| "first_name"=> "Aris", | |
| "last_name"=> "Pee", | |
| "dob"=> array( |
This file contains hidden or 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 | |
| // here is the auth ID in the payment AU55jNSyU95a4o2ZFhUFgrMH | |
| //init | |
| Payline\Settings::configure(variable_get('aaa', ''), variable_get('bbb', ''), variable_get('ccc', '')); | |
| Payline\Bootstrap::init(); | |
| //here are the code to capture the auth based on tutorial here: http://developer.payline.io/. | |
| $auth = Payline\Resources\Authorization::retrieve("AU55jNSyU95a4o2ZFhUFgrMH"); |
This file contains hidden or 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
| #1. recreate the feature_module with additional fields/views/menu. Don't forget to increase the version number | |
| #2. Download the feature_module | |
| #3. Replace the feature_module with the new one. | |
| #4. Update the feature_module | |
| drush fu feature_module | |
| #5. Update module the feature_module | |
| drush updb -y | |
| #6. done. |
This file contains hidden or 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 fe -y f_registration_views views_view:content_list --version-increment |
This file contains hidden or 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
| copy /b *.txt newfile.txt |
This file contains hidden or 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 freevps.us/downloads/bench.sh -O - -o /dev/null|bash |
This file contains hidden or 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
| mysqldump -h[DB-HOST] -u[DB-USER] -p[DB-PASS] --add-drop-table --no-data [DB-NAME] | grep -e '^DROP \| FOREIGN_KEY_CHECKS' | mysql -h[DB-HOST] -u[DB-USER] -p[DB-PASS] [DB-NAME] |
This file contains hidden or 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 | |
| /** | |
| * Hide first name & last name from user account (additional fields), on render it. | |
| * @param type $vars | |
| */ | |
| function mymodule_preprocess_field(&$vars) { | |
| if (in_array($vars['element']['#field_name'], array('field_first_name', 'field_last_name'))) { | |
| $vars['items'] = array(); //remove the value | |
| $vars['label_hidden'] = true; //hide the label |
This file contains hidden or 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 | |
| //load phpquery library here. | |
| require('phpQuery/phpQuery.php'); | |
| //sample URL | |
| $url = 'http://www.b*ngg**d.com/Wholesale-Mobile-Phones-c-140.html'; | |
| // load the url using curl | |
| $ch = curl_init(); |
NewerOlder