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
/** | |
* Jon Brown's Local WordPress configuration file | |
* | |
* @Author Jon Brown <http://wanderingjon.com> | |
* @Version 3.0 | |
* @Author URI http://www.jbrownstudios.com | |
* @Atributuon Mark Jaquith <http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/> | |
* @License GPLv2 | |
*/ |
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 | |
/** | |
* Exclude scripts from Scripts to Footer plugin | |
* http://wordpress.org/plugins/scripts-to-footerphp/ | |
* | |
* In this example, we will use jQuery (hosted on Google's servers even) | |
*/ | |
add_action( 'wp_print_styles', 'jdn_deregister_scripts', 100 ); | |
add_action( 'wp_head', 'jdn_head_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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network :forwarded_port, guest: 3000, host: 3000 | |
config.vm.network :private_network, ip: "10.11.12.13" | |
config.ssh.forward_agent = true | |
config.vm.synced_folder ".", "/vagrant" | |
config.vm.boot_timeout = 120 |
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
stat -c "%a %n" * | |
// -c is for file format, %a is for octal, %n is for file name | |
//http://geeklog.adamwilson.info/article/58/getting-file-permissions-in-octal-on-OS-X | |
//OSX Yosemite does not work with -c use: | |
stat -f '%A %a %N' * |
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
//Enable shortcodes in WordPress SEO generated Meta Description with HTML removed | |
add_filter( 'wpseo_metadesc', 'am_enable_shortcodes_removed_html' ); //see https://yoast.com/wordpress/plugins/seo/api/ | |
function am_enable_shortcodes_removed_html($metadesc) { | |
if( strpos($metadesc, 'et_pb_section') !== FALSE ) { | |
global $post; | |
$rendered_content = apply_filters('the_content', $post->post_content); | |
$newmetadesc = strip_tags( $rendered_content ); | |
return substr($newmetadesc, 0, 156); |
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('template_include', 'my_function_name', PHP_INT_MAX, 2 ); | |
function my_function_name( $template ) { | |
if(is_page('about')){ | |
$template = dirname( __FILE__ ) . '/templates/about.php'; | |
} | |
return $template; | |
} |
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 | |
#Setup SFTP Group and Service | |
function setup(){ | |
#Create sftpusers group. | |
sudo groupadd sftpusers | |
#Comment out setting disabling SFTP access from sshd config file. | |
sudo sed -i "s/Subsystem sftp \/usr\/lib\/openssh\/sftp-server/#Subsystem sftp \/usr\/lib\/openssh\/sftp-server/" /etc/ssh/sshd_config |
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
/** | |
* WooCommerce Quanity buttons add-back | |
*/ | |
jQuery( function( $ ) { | |
var $testProp = $( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).find('qty'); | |
if ($testProp && $testProp.prop('type') != 'date') { | |
// Quantity buttons | |
$( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' ); | |
// Target quantity inputs on product pages |
Note: if you need a simple connection icon, check out BitBar and its internet checker plugin.
This program notifies you when Internet goes down and when it comes back up.
It pings Google's DNS every 4 seconds; when a ping fails it quickly tries a few more times and switches to downtime mode. When Internet is available again, the cycle restarts.
OlderNewer