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
| UPDATE `customer_entity` | |
| SET `password_hash` = CONCAT(SHA2('xxxxxxxxYOURPASSWORD', 256), ':xxxxxxxx:1') // change YOURPASSWORD to your password to reset | |
| WHERE `entity_id` = 19975 and `email`="[email protected]"; |
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
| ALTER TABLE master_activity_log CHANGE `from_user_id` `user_id` INT(11); // change column name | |
| ALTER TABLE master_activity_log DROP log_date; // remove column | |
| ALTER TABLE master_activity_log ADD COLUMN log_datetime DATETIME AFTER after_save; // create new column of existing table | |
| Truncate foreign key constraints table : | |
| SET FOREIGN_KEY_CHECKS = 0; | |
| TRUNCATE TABLE `table name`; | |
| SET FOREIGN_KEY_CHECKS=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
| /var/www/html/var/log/*.log { | |
| daily | |
| missingok | |
| rotate 14 | |
| compress | |
| notifempty | |
| create 0777 www-data www-data | |
| } | |
| setup cron job |
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
| To split the date and time from datetime value | |
| $date = strtotime('8/29/2011 11:16:12 AM'); | |
| $dat = date('m/d/y', $date); | |
| $tme = date('H:m:s A',$date); | |
| ucfirst() - makes the first letter of the input string uppercase. | |
| upfirst('hello world!') - returns 'Hello world!'; |
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
| /var/www/html/var/log/*.log { | |
| daily | |
| missingok | |
| rotate 14 | |
| compress | |
| notifempty | |
| create 0777 magento2-file-username magento2-file-username | |
| } |
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
| git clone [git URL] - to clone the URL from gitlab/github/bitbucket | |
| git branch -a - to list current to remote branch | |
| git checkout [branch name] - to move/checkout to branch name | |
| git status - to view the status of the local files and remote branch files in cloud | |
| git diff [file] - to view the different between local and remove file | |
| git add [files with a space] - to add new files to the repo | |
| git commit -m "commit msg" - to commit with message | |
| git push - push the code to the repo | |
| # add remote |
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
| Better performance - PHP 7 is twice as fast as PHP 5.6. Optimization | |
| Scalar type declarations - pass function params with variable type | |
| function sum (int $a, int $b){ | |
| } | |
| Return type declarations - mention the return variable type of a function | |
| function sum ($a, $b): int{ |
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
| /* | |
| * disable auto-zoom on iphone input field focus | |
| * http://www.456bereastreet.com/archive/201212/ios_webkit_browsers_and_auto-zooming_form_controls/ | |
| */ | |
| input[type='text']:focus, | |
| input[type='number']:focus, | |
| textarea:focus { | |
| font-size: 16px; | |
| } |
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
| // detect the Enter key in a text input field | |
| $(".input1").on('keyup', function (e) { | |
| if (e.keyCode === 13) { | |
| // Do something | |
| } | |
| }); | |
| // array for..of cycle | |
| // tip: you can stop iterating at any time using a break statement. |
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
| /* | |
| This is from | |
| http://uihacker.blogspot.com/2011/04/javascript-handle-touch-gestures-for.html | |
| I wrote a little class to handle pinch & rotate gestures on a web page in iOS. There's a bunch of event listener adding/removing, which can get a little messy, so this should help keep your code clean if you need to handle gestures. | |
| Here's the class: | |
| */ | |
| function GestureCallback( element, endCallback, changeCallback ) { |