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 | |
| $csv_data = generate_csv_file_data($from_date, $to_date); | |
| header("Pragma: public"); | |
| header("Expires: 0"); | |
| header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); | |
| header("Cache-Control: private", false); | |
| header("Content-Type: application/octet-stream"); | |
| header("Content-Disposition: attachment; filename=\"report.csv\";" ); |
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) is_admin() check and AJAX Call | |
| ================================= | |
| // Is admin, but not doing ajaax | |
| if( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { | |
| require_once('admin/functions_admin.php'); | |
| } | |
| // Is doing AJAX | |
| else if ( is_admin() && ( defined( 'DOING_AJAX' ) || DOING_AJAX ) ) { | |
| require_once('functions_ajax.php'); | |
| } |
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
| When we need to transfer/import a repository into new repository without loosing the all the prior commits. | |
| Then follow the below steps. | |
| 1) Create a new repo with no any previous/initial commits like gitignore files or readme files. | |
| Because this will create conflict with existing repo file of old repository. | |
| 2) Then clone the remote repo into a desired folder on your local system. | |
| 3) Checkout all the required remote branches in to the local branch. |
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
| WP-CLI | |
| ======= | |
| WP-CLI is a command line interface for wordpress. You can install WP, update plugin, install plugin, configure multisite and Much more without using web browser. | |
| Download the wp-cli.phar file using wget or curl. | |
| curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
| Then, check if it works: |
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
| Temporal Dead Zone (TDZ) and Hoisting in JavaScript: | |
| Temporal Dead Zone: | |
| =================== | |
| Area of a block where the javascript variable is inaccessible untill the moment the computer completely intialised. | |
| Block is a pair of braces used to group multiple braces. | |
| Initialisation means: assigning a value to a variable. |
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
| ES6 Features: | |
| Classes. | |
| Arrow functions. | |
| Variable (let, var, const) | |
| Array methods like .map(). | |
| Destructuring. | |
| Modules. | |
| Ternary Operator. | |
| Spread Operator. |
OlderNewer