Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
<?php | |
/** | |
* Basic configuration for multiple DFP JS ad tags in Ad Code Manager | |
* | |
* Our ad units are named 'test_ad_300x250' and 'test_ad_728x90' | |
* Our DFP ID is 12345678 | |
* Our ad slot IDs will be automatically created | |
* | |
*/ |
/** | |
* This casper scipt checks for 404 internal links for a given root url. | |
* | |
* Usage: | |
* | |
* $ casperjs 404checker.js http://mysite.tld/ | |
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42 | |
*/ | |
/*global URI*/ |
# Adjust this to include any other necessary files. | |
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
resolver 1.1.1.1; | |
proxy_pass http://{replace-with.domain.com}/$uri; |
THIS REPO HAS MOVED! It has graduated to a dedicated GitHub project: https://github.com/x-team/vassh
The big pain of doing vagrant ssh
is that it doesn’t drop you into the corresponding working directory in the Vagrant guest’s synced_folder, so you have to cd
to the dir and then run whatever you needed to do (e.g. wp core update
). This is the problem that vassh
solves: it will make sure you start out in the corresponding directory. So if you’re in your WordPress project on your host machine, all you need to do is:
$ vassh wp core update
There’s also a wrapper called vasshin
which will shell you into Vagrant at the current directory, with a prompt for entering commands. This gets you colors and interactive TTY. You can also pass commands as arguments to vasshin
to have them executed right away in the colorized TTY (with some additional Vagrant .bash_login
echoes and SSH connection close):
<?php | |
$posts = new posts_loop(); | |
foreach( $posts as $id => $post ) { | |
the_title(); | |
// etc... | |
} | |
// put this below in your functions.php: |
<script> | |
var file_frame; | |
var wp_media_post_id = wp.media.model.settings.post.id; | |
var set_to_post_id = <?php echo get_the_ID(); ?>; | |
jQuery('.upload_image_button').on('click', function( event ){ | |
event.preventDefault(); |
jQuery( document ).ready( function() { | |
function pu01_show_image() { | |
var pu01_image_1 = jQuery( '#pu01_image_1' ).val(), | |
pu01_image_2 = jQuery( '#pu01_image_2' ).val(), | |
pu01_image_3 = jQuery( '#pu01_image_3' ).val(); | |
jQuery( '#pu01_image_1_preview' ).after( '<div id="pu01_image_1_preview_image"><img width="300" height="140" src="' + pu01_image_1 + '" /></div>' ); | |
jQuery( '#pu01_image_2_preview' ).after( '<div id="pu01_image_2_preview_image"><img width="300" height="140" src="' + pu01_image_2 + '" /></div>' ); |