Skip to content

Instantly share code, notes, and snippets.

@thisismitch
thisismitch / le-renew-webroot
Last active April 26, 2024 04:13
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@johnbillion
johnbillion / wp_mail.md
Last active January 27, 2024 14:06
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@austinpray
austinpray / Smart-Checkboxes.markdown
Last active August 29, 2015 14:15
Smart Checkboxes
@cfxd
cfxd / gf.php
Created November 13, 2014 17:49
Populate Gravity Forms in an ACF select field named "subscribe_form_header"
<?php
function populate_gravity_forms($field) {
if(class_exists('RGFormsModel')) {
$forms_array = array();
$forms = RGFormsModel::get_forms(null, 'title');
foreach($forms as $form) {
$forms_array[$form->id] = $form->title;
@cfxd
cfxd / chosenjs-less-for-bootstrap-and-woocommerce-checkout.less
Last active August 29, 2015 14:03
This will style WooCommerce's ChosenJS select boxes on the WooCommerce checkout page to match your existing Bootstrap form styles (assuming you've made any style changes in LESS) and even replaces the default background images with Bootstrap's built in Glyphicons.
// first some helpful mixins
.abs {
position: absolute;
}
.rel {
position: relative;
}
.position(@top; @right; @bottom; @left) {
top: @top;
right: @right;
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version '>= 1.5.1'
Vagrant.configure('2') do |config|
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
config.vm.network :private_network, ip: '192.168.50.5'
@NateWr
NateWr / imager-for-wp.php
Created March 12, 2014 01:07
Integrate Imager.js with WordPress
<?php
/**
* Integrate Imager.js with WordPress
*
* Imager.js is BBC's solution for serving responsive and retina images, without
* the double payload issues that affect other solutions. For more information:
*
* https://github.com/BBC-News/Imager.js/
*
* This collection of functions modifies the output of WordPress's
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
<?php
/*
Plugin Name: Image Optimizer
Plugin URI:
Description: Automatically optimizes images using jpegtran and optipng on upload
Version: 0.1
Author: Scott Walkinshaw
Author URI:
Support URI:
*/