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 | |
class SwpProgrammaticCustomFields { | |
// These meta keys will be indexed and made searchable | |
private $meta_keys = array( | |
array( | |
'post_type' => 'post', | |
'meta_keys' => array( | |
array( |
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
#https://github.com/dcosson/vagrant-unison2 | |
yum install ocaml ocaml-camlp4-devel ctags ctags-etags | |
cd ~ | |
wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gz | |
tar xvfz unison-2.48.4.tar.gz | |
cd src | |
make |
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/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-macos10.12-x86_64.tar.gz | |
tar xfvz mysql-5.7.18-macos10.12-x86_64.tar.gz | |
echo "Stopping MAMP" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "Copy Bin" |
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
# Based on http://fearby.com/article/update-openssl-on-a-digital-ocean-vm/ | |
$ sudo apt-get update | |
$ sudo apt-get dist-upgrade | |
$ wget ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz | |
$ tar -xvzf openssl-1.0.2h.tar.gz | |
$ cd openssl-1.0.2h | |
$ ./config --prefix=/usr/ | |
$ make depend |
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
# /etc/nginx/cloudflare.conf | |
# If using Cloudflare, uncomment the following to get proper originating IPs | |
#set_real_ip_from 204.93.240.0/24; | |
#set_real_ip_from 204.93.177.0/24; | |
#set_real_ip_from 199.27.128.0/21; | |
#set_real_ip_from 173.245.48.0/20; | |
#set_real_ip_from 103.22.200.0/22; | |
#set_real_ip_from 141.101.64.0/18; | |
#real_ip_header CF-Connecting-IP; |
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
downloadJSAtOnload = -> | |
scripts = [ | |
{ src: '//www.googleadservices.com/pagead/conversion.js' } # Google Adwords | |
{ src: '//platform.twitter.com/oct.js' } # Twitter Conversion Tracking | |
{ src: "//js.hubspot.com/analytics/#{(Math.ceil(new Date()/300000)*300000)}/123456.js", id: 'hs-analytics' } # Hubspot | |
{ src: '//tag.perfectaudience.com/serve/SHASHASHASHASHASHA.js' } # Perfect Audience | |
{ src: '//cdn.bizible.com/_biz-a.js', id: 'bizible-settings' } # Bizible | |
{ src: "#{if ("https:" is document.location.protocol) then "https://s" else "http://a"}.adroll.com/j/roundtrip.js" } # Adroll | |
] | |
for script in scripts |
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
# Get Graphics Magick | |
> cd / | |
> mkdir /dowload | |
> cd /download | |
> wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/GraphicsMagick-LATEST.tar.gz | |
> tar -xzvf GraphicsMagick-LATEST.tar.gz | |
> cd GraphicsMagick-1.3.21 (or the lastest graphics magick) | |
# Install Graphics Magick | |
## Get libs |
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
user web; | |
# One worker process per CPU core. | |
worker_processes 8; | |
# Also set | |
# /etc/security/limits.conf | |
# web soft nofile 65535 | |
# web hard nofile 65535 | |
# /etc/default/nginx |
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
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
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('posts_clauses', 'posts_clauses_with_tax', 10, 2); | |
function posts_clauses_with_tax( $clauses, $wp_query ) { | |
global $wpdb; | |
//array of sortable taxonomies | |
$taxonomies = array('example-taxonomy', 'other-taxonomy'); | |
if (isset($wp_query->query['orderby']) && in_array($wp_query->query['orderby'], $taxonomies)) { | |
$clauses['join'] .= " | |
LEFT OUTER JOIN {$wpdb->term_relationships} AS rel2 ON {$wpdb->posts}.ID = rel2.object_id | |
LEFT OUTER JOIN {$wpdb->term_taxonomy} AS tax2 ON rel2.term_taxonomy_id = tax2.term_taxonomy_id | |
LEFT OUTER JOIN {$wpdb->terms} USING (term_id) |
NewerOlder