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
$ dig yourdomain.com ANY @8.8.8.8 |
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
# Pull images from remote site instead of local | |
# only if file requested is from the uploads folder | |
# and if the file does not exist locally | |
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ https://SOMESITE.com/$1 [QSA,L] |
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 | |
# Create a base64 data URI from an image and copy it to clipboard. | |
# Uses OpenSSL to create the base64 representation. | |
the_mimetype=$(file -bN --mime-type "$1") | |
the_content=$(openssl base64 < "$1" | tr -d '\n') | |
# Use printf instead of echo to avoid the ending newline | |
printf "data:$the_mimetype;base64,$the_content" | pbcopy |
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
ffmpeg -i video.mp4 %04d.png && montage -geometry $(identify -format '%wx%h' $(ls | sort | head -1)) -tile 8x *.png sprite.jpg && echo $(ls *.png | wc -l) "frames" && rm *.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
#!/bin/bash | |
# This script creates a compressed backup archive of the given directory and the given MySQL table. More details on implementation here: http://theme.fm | |
# Feel free to use this script wherever you want, however you want. We produce open source, GPLv2 licensed stuff. | |
# Author: Konstantin Kovshenin exclusively for Theme.fm in June, 2011 | |
# Original link: https://theme.fm/a-shell-script-for-a-complete-wordpress-backup/ | |
# Set the date format, filename and the directories where your backup files will be placed and which directory will be archived. | |
NOW=$(date +"%Y-%m-%d-%H%M") |
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 a help tab to the new/edit post screen. | |
* Action: admin_head-post.php, admin_head-post-new.php | |
*/ | |
function cmfy_add_gumbo_help_tab() { | |
// Get the WP_Screen object | |
$screen = get_current_screen(); | |
// Adjust / remove this conditional depending on which hook you're firing on |
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 guidance text to the featured image metabox. | |
* Filter: admin_post_thumbnail_html | |
* | |
* @param string $content Meta box HTML | |
* @param integer $post_id ID of post | |
* @return string | |
*/ | |
function cmfy_featured_image_help_text( $content, $post_id ) { |
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 a character counter to post excerpts in WordPress admin. | |
* Action: admin_head-post.php, admin_head-post-new.php | |
* Inspired by @link: https://premium.wpmudev.org/blog/character-counter-excerpt-box/ | |
*/ | |
function cmfy_excerpt_character_counter() { | |
// If post type does not support excerpt, do nothing | |
if ( ! post_type_supports( get_post_type(), 'excerpt' ) ) { | |
return; |
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 | |
// Custom theme colors | |
$cmfy_custom_colors = array( | |
'14bed2' => __( 'Primary blue', 'cmfy' ), | |
'cadd69' => __( 'Primary green', 'cmfy' ), | |
'70736f' => __( 'Primary gray', 'cmfy' ), | |
'f26722' => __( 'Secondary orange', 'cmfy' ), | |
'fdbb4a' => __( 'Secondary yellow', 'cmfy' ), | |
); |
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
add_filter( 'install_plugins_tabs', 'cmfy_required_plugins_tab' ); | |
function cmfy_required_plugins_tab( $tabs ) { | |
$tabs['cmfy'] = _x( 'Required', 'Plugin Installer', 'cmfy' ); | |
return $tabs; | |
} | |
add_action( 'install_plugins_cmfy', 'cmfy_required_plugins_page' ); | |
function cmfy_required_plugins_page() { | |
$required_plugin_slugs = array( | |
'cmb2', |
NewerOlder