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
1. Open cmd | |
2. Go to the directory for which you need the listings | |
3. Run tree /a /f > output.txt | |
A file will be created in the directory with the name output.txt |
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 | |
$cleaned = preg_replace('/'. preg_quote($remove, '/') . '$/', '', $cleaned); | |
//$remove -> The string to be removed which is input by the user | |
// Or you can use a regular expression as shown below | |
$cleaned = preg_replace('/\[\]$/', '', $cleaned); // => Removes square brackets at the end of the string. |
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
CSS rules have weight, and you should leverage those rules to correctly cascade styles. | |
element = 1 pt | |
class = 10 pt | |
id = 100 pt | |
inline = 1000 pt | |
An ID has a relatively high specificity of 100. A class has a specificity of 10. | |
#idname.classname - Now this selector has a specificity of 110. |
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
If you see the command screen get stuck for minutes after running "npm install" then check if package-lock.json is still in the folder. | |
Remove the package-lock.json file before running "npm install". | |
If issue still persists, please follow the guide below. | |
http://www.jonahnisenson.com/running-npm-install-hangs-and-hangs-and-hangs/ |
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
<script> | |
if(event.target.tagName.toLowerCase() === 'div'){ | |
} | |
</script> |
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
//Choose first two and last two childs | |
p:nth-child(-n + 2) { | |
color: orange; | |
} | |
p:nth-last-child(-n + 2) { | |
color: orange; | |
} |
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
function json_encode(){ | |
var content = []; | |
content.field1 = { width: "100px", height: "400px", label : "Width"}; | |
content.field2 = { width: "200px", height: "500px", label : "Height"}; | |
console.log(JSON.stringify(content)); | |
} | |
// The above function return [] because the key used here is a string. | |
//The array key should be integer for JSON.stringify to return proper value |
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
The reason for not allowing html inside the content parameter is the fact that CSS is designed to work in a | |
single pass-through of the page. If there were html, that would need to be styled, which means the css would | |
need to come back and process itself all over again to style that HTML after it was done styling everything else. | |
This extra functionality would rarely be used by anyone but would still come with a speed cost to everyone |
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 | |
//https://wordpress.stackexchange.com/questions/144343/wp-reset-postdata-or-wp-reset-query-after-a-custom-loop | |
The difference between the two is that | |
-> wp_reset_query() - ensure that the main query has been reset to the original main query | |
-> wp_reset_postdata() - ensures that the global $post has been restored to the current post in the main query. | |
wp_reset_query() calls wp_reset_postdata(). The only difference between the two then is this line: |
NewerOlder