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
#!/usr/bin/bash | |
# Dotroll domain api | |
# - api access values stored per domain, including migration from account stored values | |
# - zone data is POST-ed to avoid "414 Request-URI Too Large" errors | |
# | |
# Initially export values Dotroll_User and Dotroll_Password | |
# export Dotroll_User='<your.dotroll@user>'; export Dotroll_Password='<dotroll_api_password>'; acme.sh --issue --dns dns_dotroll -d <domain.tld> -d '*.<domain.tld>' | |
# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" |
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
# USEFUL PLESK COMMANDS | |
# restart plesk | |
/etc/init.d/psa restart | |
# reload plesk configs (useful for vhost.conf) | |
/usr/local/psa/admin/sbin/websrvmng -a -v | |
# restart qmail | |
service qmail restart |
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 | |
/* | |
* Force File Download | |
* Usage: http://example.com/download.php?file=./uploads/image.jpg | |
* | |
* There are a couple of *ninja* exit() as security guarantee, adapt as necessary | |
* | |
*/ | |
// grab the requested file's name |
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
log_format postdata '$time_local $request $request_body'; | |
location = /path { | |
access_log /var/log/nginx/postdata.log postdata; | |
proxy_pass http://localhost:8080; # <= set your port | |
} |
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 | |
## | |
# Script to run WP All Import scripts sychronously with cron | |
## | |
# This is default wp core directory for us | |
ABSPATH="/var/www/project/wp" | |
function usage() | |
{ |
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 | |
// find out if there was an exact match | |
global $wpdb; | |
if ( defined( 'SEARCHWP_DBPREFIX' ) && SEARCHWP_DBPREFIX ) { | |
$searchwp_terms_table = $wpdb->prefix . SEARCHWP_DBPREFIX . 'terms'; | |
$search_query = sanitize_text_field( get_search_query() ); | |
$search_sql = "SELECT id FROM {$searchwp_terms_table} WHERE term = %s"; | |
$term_found = $wpdb->get_var( $wpdb->prepare( $search_sql, $search_query ) ); | |
$exact_match = is_null( $term_found ) ? false : true; |
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
<IfModule mod_headers.c> | |
Header add Link "</service-worker.js>; rel=preload;" | |
Header add Link "</favicon-16x16.png>; rel=preload;" | |
Header add Link "</favicon-96x96.png>; rel=preload;" | |
Header add Link "</android-chrome-192x192.png>; rel=preload;" | |
Header add Link "<https://cdn.ampproject.org/v0.js>; rel=preload; crossorigin" | |
Header add Link "<https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface>; rel=preload; crossorigin" | |
Header add Link "<https://cdn.ampproject.org/v0/amp-analytics-0.1.js>; rel=preload; crossorigin" | |
Header add Link "<https://cdn.ampproject.org/v0/amp-install-serviceworker-0.1.js>; rel=preload; crossorigin" | |
Header add Link "<https://fonts.gstatic.com/s/abrilfatface/v8/X1g_KwGeBV3ajZIXQ9VnDgYWpCd0FFfjqwFBDnEN0bM.woff2>; rel=preload; crossorigin" |
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
(function () { | |
document.addEventListener('DOMContentLoaded', function(){ | |
var stylesheets = document.styleSheets; | |
var wHeight = window.innerHeight; | |
var criticalCSS = ''; | |
var uniqueRules = []; | |
var criticalRules = []; | |
console.log(stylesheets); |
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
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
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
#######BEGIN SCRIPT############ | |
#!/bin/bash | |
# This checks that the specified file is less than 28 hours old. | |
# returns 0 if younger than 28 hours. | |
# returns 1 if older than 28 hours. | |
#funtion arguments -> filename to comapre against curr time | |
function comparedate() { | |
if [ ! -f $1 ]; then | |
echo "file $1 does not exist" |
NewerOlder