Skip to content

Instantly share code, notes, and snippets.

View theukedge's full-sized avatar

Dave Clements theukedge

View GitHub Profile
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name dave.pe;
ssl_certificate /etc/letsencrypt/live/dave.pe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dave.pe/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80; ## listen for ipv6
server_name dave.pe www.dave.pe;
root /usr/share/nginx/dave.pe/html;
index index.php index.html index.htm;
openssl dhparam -out /etc/nginx/dhparam.pem 2048
./letsencrypt-auto --server https://acme-v01.api.letsencrypt.org/directory auth -d dave.pe -d www.dave.pe
sudo service nginx stop
cd ~
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
<?php function add_video_suffix( $title, $id = null ) {
if( in_the_loop() && in_category( 'Videos', $id ) ) {
$title .= ' [VIDEO]';
}
return $title;
}
add_filter( 'the_title', 'add_video_suffix' );
touch deploy.sh
chmod 755 deploy.sh
<?php
// Enable the plugin only when Jetpack and Sharedaddy are enabled
function shortlinks_for_sharing_buttons() {
if (
class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'get_active_modules' ) && in_array( 'sharedaddy', Jetpack::get_active_modules() )
) {
add_filter( 'sharing_permalink', 'get_shortlink_for_post' );
}
<?php /* Disable specified plugins in development environment */
if ( defined( 'WP_ENV' ) && WP_ENV == 'dev' ) {
$plugins = array(
'iwp-client/init.php',
'google-analytics-for-wordpress/googleanalytics.php',
);
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
deactivate_plugins($plugins);