This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
<?php | |
/* | |
################### READ ME ################################# | |
You'll pass the URL to your feed/file to this function inside the "Download from URL" option when creating an import. | |
Image examples: https://d.pr/hCfNek and https://d.pr/MnerNb. | |
1. [custom_file_download("ftp://username:[email protected]/full/path/to/file.csv","csv")] | |
2. [custom_file_download("http://example.com/full/path/to/file.csv","csv")] |
<?php | |
/** | |
* Extract PDF content from a file uploaded via ACF File field (where | |
* the actual data stored is only the Media ID) and store PDF | |
* content as SearchWP 'extra' metadata so it can be included in | |
* searches and attributed to the post itself, not the Media entry | |
*/ | |
class My_SearchWP_Customizations { |
server { | |
listen 443; | |
server_name example.com; | |
error_log /var/log/nginx/example_com_error.log warn; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/your.crt; #certificate chains | |
ssl_certificate_key /etc/nginx/ssl/your.key; #private key | |
<?php | |
function sumobi_edd_empty_cart_redirect() { | |
$cart = function_exists( 'edd_get_cart_contents' ) ? edd_get_cart_contents() : false; | |
$redirect = site_url( 'shop' ); // could be the URL to your shop | |
if ( function_exists( 'edd_is_checkout' ) && edd_is_checkout() && ! $cart ) { | |
wp_redirect( $redirect, 301 ); | |
exit; | |
} |
# | |
# Slightly tighter CORS config for nginx | |
# | |
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
# | |
# Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
# don't seem to play nicely with this. | |
# |
<?php | |
/** | |
* Iterates over results of a query, split into many queries via LIMIT and OFFSET | |
*/ | |
class QueryIterator implements Iterator { | |
var $limit = 500; | |
var $query = ''; | |
var $global_index = 0; |
### Testing if the client is a mobile or a desktop. | |
### The selection is based on the usual UA strings for desktop browsers. | |
## Testing a user agent using a method that reverts the logic of the | |
## UA detection. Inspired by notnotmobile.appspot.com. | |
map $http_user_agent $is_desktop { | |
default 0; | |
~*linux.*android|windows\s+(?:ce|phone) 0; # exceptions to the rule | |
~*spider|crawl|slurp|bot 1; # bots | |
~*windows|linux|os\s+x\s*[\d\._]+|solaris|bsd 1; # OSes |