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
pngquant -f --ext .png **/*.png |
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 | |
/** | |
* 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 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 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
# redirects for url params | |
RewriteEngine On | |
RewriteRule ^([a-zA-Z0-9-z\-\_]+)$ index.php?page=$1 | |
RewriteRule ^([a-zA-Z0-9-z\-\_]+)/$ index.php?page=$1 | |
RewriteRule ^([a-zA-Z0-9-z\-\_]+)/([a-zA-Z0-9-z\-\_]+)$ index.php?page=$1&subpage=$2 | |
RewriteRule ^([a-zA-Z0-9-z\-\_]+)/([a-zA-Z0-9-z\-\_]+)/$ index.php?page=$1&subpage=$2 | |
# index file priority | |
DirectoryIndex index.html index.htm index.php welcome.html |
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
# download stable Drupal | |
drush dl drupal | |
# install Drupal site with admin/admin acc | |
sudo drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://drupal7:drupal7@localhost/drupal7 | |
# clear drupal cache | |
drush cc | |
# download and enable module |
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
#!/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 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 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 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 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] |
NewerOlder