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 | |
| /** | |
| * Add data attributes to the query block to describe the block query. | |
| * | |
| * @param string $block_content Default query content. | |
| * @param array $block Parsed block. | |
| * @return string | |
| */ | |
| function query_render_block( $block_content, $block ) { | |
| if ( 'core/query' === $block['blockName'] ) { |
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
| #!/bin/bash | |
| find "$PWD" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.mp4}.webm"' {} \; | |
| exit; |
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
| 0x944A6120ce6D69F351149020c230F466C45eE427 |
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 | |
| /** | |
| * Instead of calling get_the_content(), call this function instead, and it'll all be good | |
| */ | |
| function get_the_content_with_formatting() | |
| { | |
| ob_start(); | |
| the_content(); | |
| $the_content = ob_get_contents(); |
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
| du -ma | sort -nr | head -n 20 |
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
| lsof -n -i4TCP:[PORT_NUMBER] |
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
| pngquant -f --ext .png **/*.png |
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
| find ./ -path '*/images/*.png' -type f -exec pngquant -f --ext .png {} \; |
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
| #searches for 'search_term' and prints all columns | |
| awk '/search_term/' file.txt | |
| #searches for 'search_term' and prints columns 1 and 4 separated with tab (the first column is index 1) | |
| awk '/search_term/ {print $1 "\t" $4}' file.txt | |
| #searches for 'search_term' and prints the number of occurances | |
| awk '/search_term/{++cnt} END {print "Count = ", cnt}' file.txt | |
| #print lines having more than 18 characters |
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
| find . -name "*.html" -exec bash -c 'cp "{}" "$(dirname "{}")"/index.html' \; |
NewerOlder