###Some don't work yet.
Get the top request methods
varnishtop -i RxRequest
Top urls that missed the cache.
varnishtop -i TxURL
<?php | |
/** | |
* Prevent top level permalink slugs that will cause conflicts. | |
* | |
* New rewrite slugs are introduced when CPTs or Custom Taxonomies are created. | |
* This code adds a check when Pages or Posts are created, that their Permalink | |
* does not conflict with one of the reserved top level slugs you define. | |
* | |
* In the case of a bad (i.e conflicting slug), WordPress appends a "-2" to | |
* the permalink. |
<?php | |
$terms = array( | |
'Birmingham - AL', | |
'Dothan - AL', | |
'Huntsville - AL', | |
'Montgomery - AL', | |
'Mobile - AL', | |
'Anchorage - AK', | |
'Fairbanks - AK', | |
'Juneau - AK', |
/** | |
* A bookmarklet for viewing the largest contentful paint in a page. | |
* Will show each LCP after the bookmarklet is clicked. | |
* | |
* To install: | |
* 1. Copy the code starting from the line beginning `javascript:` | |
* 2. Add a new bookmark in Chrome, and paste the code in as the URL. | |
**/ | |
javascript:(function(){ | |
try { |
#!/bin/bash | |
# CloudWays - Download local backups for all applications | |
# ======================================================= | |
# * Local backups must be enabled and available. See https://support.cloudways.com/how-to-download-a-full-backup/ | |
# * Add your machine's SSH key to your server so this script needs no input. | |
# * Backups will be saved inside a new folder with today's date within your nominated backup directory. (This might not be the date the backup was taken.) | |
# * Only tested on Digital Ocean VPS so far. | |
# Configuration |
// THE BELOW WORKS FOR LOCAL WINDOWS MACHINE FROM A WAMP HOSTED CODEIGNITER SITE - CALL MADE FROM CODEIGNITER CONTROLLER | |
$myCmd = "C://wamp//bin//wkhtmltopdf//wkhtmltopdf.exe http://proofofconcept.proximitystage.com/email-media-queries C://Users//mosley.j//Desktop//jonnny.pdf"; | |
$result = exec($myCmd,$output,$var); | |
var_dump($output); | |
var_dump($var); | |
// BELOW IS THE CMD LINE CODE/STEPS YOU NEED IN ORDER TO RUN THE SAME THING FROM PURE CMD LINE |
<!-- // The HTML (could be part of page content) // --> | |
<input type="text" name="keyword" id="keyword" onkeyup="fetch()"></input> | |
<div id="datafetch">Search results will appear here</div> |
<?php | |
function require_auth() { | |
$AUTH_USER = 'admin'; | |
$AUTH_PASS = 'admin'; | |
header('Cache-Control: no-cache, must-revalidate, max-age=0'); | |
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW'])); | |
$is_not_authenticated = ( | |
!$has_supplied_credentials || | |
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER || | |
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS |
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# | |
# This file specifies intentionally untracked files to ignore |
###Some don't work yet.
Get the top request methods
varnishtop -i RxRequest
Top urls that missed the cache.
varnishtop -i TxURL
( function( $, plugin ) { | |
"use strict"; | |
// Working with promises to bubble event later than core. | |
$.when( someObjectWithEvents ).done( function() { | |
console.log( 'AJAX request done.' ); | |
} ) | |
.then( function() { | |
setTimeout( function() { | |
console.log( 'AJAX requests resolved.' ); |