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 | |
/** | |
* Super-simple AWS CloudFront Invalidation Script | |
* | |
* Steps: | |
* 1. Set your AWS access_key | |
* 2. Set your AWS secret_key | |
* 3. Set your CloudFront Distribution ID | |
* 4. Define the batch of paths to invalidate | |
* 5. Run it on the command-line with: php cf-invalidate.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
# Hyper-V only overrides | |
config.vm.provider :hyperv do |v, override| | |
# Update memory and CPUs to match VVV config. | |
v.memory = 1024 | |
v.cpus = 1 | |
# Use a Hyper-V compatible base box | |
override.vm.box = "ericmann/trusty64 | |
# Change all the folder to use SMB instead of Virtual Box shares |
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
/** | |
* Get or update post meta via the WordPress REST API | |
* | |
* @param int $post_id Post ID to get meta for. | |
* @param bool|string $json_url Optional. Base URL for API. If false will use current site's API URL. | |
* @param array $headers Headers to use in request. Must at least include authorization. | |
* @param bool $update Optional. If true updates meta value, if false just returns current values. | |
* @param bool|array $meta_data Optional, but required if updating. Array of key => value for meta ID being updated. | |
* @param bool|int $meta_id Optional. ID of meta key to update. If not specified and updating an additional HTTP request is required to find it. | |
* |
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 | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
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
/* | |
* This is the bare minimum CSS necessary to make jQuery UI tabs "work". | |
* Obviously you'll need to do a lot more styling to make them "good" :) | |
*/ | |
.ui-tabs-hide { display: none; } |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<style> | |
#main-container { |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<!--[if !mso]><!--> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<!--<![endif]--> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title></title> | |
<link rel="stylesheet" type="text/css" href="styles.css"> |
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
location ~* \.(jpe?g|gif|png)$ { | |
try_files $uri @photon; | |
} | |
location @photon { | |
rewrite ^(.*)-([0-9]+)x([0-9]+)\.(jpe?g|gif|png)$ http://i0.wp.com/$host$1.$4?resize=$2,$3; | |
rewrite . http://i0.wp.com/$host$request_uri; | |
} |
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
add_filter( 'excerpt_length', 'my_excerpt_length' ); | |
function my_excerpt_length( $length ) { | |
return 110; | |
} |
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
/** | |
* Override WP oEmbed | |
* @version 1.0 | |
*/ | |
add_filter( 'embed_oembed_html', 'mycred_override_video_shortcode', 999, 4 ); | |
function mycred_override_video_shortcode( $original, $url, $attr, $post_ID ) { | |
// If myCRED is not enabled | |
if ( ! function_exists( 'mycred_render_shortcode_video' ) ) return $original; | |
// Get cache |
NewerOlder