Skip to content

Instantly share code, notes, and snippets.

Docker + Traefik + Let's Encrypt + Github Repository
Using:
- Ubuntu 19.04
- Docker Engine 19.03
- Docker Compose 1.25.0-rc2
- Traefik v1.7.18 with dnsChallenge
- Traefik v2.0.1 with httpChallenge
--
- Github Registry
@renowncoder
renowncoder / Caddyfile
Created April 26, 2021 11:26 — forked from Ocramius/Caddyfile
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
:80 {
root /serve
}
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@renowncoder
renowncoder / iso_gf_min_sum_validation.php
Created April 28, 2021 20:44 — forked from isotrope/iso_gf_min_sum_validation.php
Sum total of all fields with a class of XXXX and throw a validation error if the sum is == 0
<?php
//Don't forget to change the _1 in the hook to the ID of your form
add_filter('gform_validation_1', 'iso_min_sum_validate');
// Most code taken from http://www.gravityhelp.com/documentation/page/Using_the_Gravity_Forms_%22gform_validation%22_Hook
function iso_min_sum_validate($validation_result) {
// We'll base our loop on CSS class
@renowncoder
renowncoder / iterm2-solarized.md
Created April 28, 2021 20:44 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@renowncoder
renowncoder / expect-header-fix.php
Created April 28, 2021 20:46 — forked from carlalexander/expect-header-fix.php
WordPress "Expect" header fix
<?php
/**
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
*/
function add_expect_header(array $arguments)
{
$arguments['headers']['expect'] = !empty($arguments['body']) && strlen($arguments['body']) > 1048576 ? '100-Continue' : '';
@renowncoder
renowncoder / keybase.md
Created April 28, 2021 20:47 — forked from carlalexander/keybase.md
keybase.md

Keybase proof

I hereby claim:

  • I am carlalexander on github.
  • I am carlalexander (https://keybase.io/carlalexander) on keybase.
  • I have a public key ASAeNjSudK8Ar5DH54HtLiabfIcP4VDFerAVPQwo_HSvbwo

To claim this, I am signing this object:

add_action('current_screen', "whats_my_hook" );
function whats_my_hook() {
global $page_hook;
echo "My page hook:" . $page_hook;
}
@renowncoder
renowncoder / custom-queries.php
Created May 6, 2021 15:53 — forked from carlodaniele/custom-queries.php
An example plugin showing how to add custom query vars, rewrite tags and rewrite rules to WordPress
<?php
/**
* @package Custom_queries
* @version 1.0
*/
/*
Plugin Name: Custom queries
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@renowncoder
renowncoder / hyperjs.md
Created May 14, 2021 11:24 — forked from raftheunis87/hyperjs.md
Hyper.js + Hyper.js Plugins + ZSH + Starship + Fira Code + Dark Theme - (macOS)

Hyper.js