Skip to content

Instantly share code, notes, and snippets.

@diije
diije / functions.php
Last active December 18, 2015 15:29 — forked from roborourke/embed-gist.php
WordPress : intégrer un gist sur votre blog.
<?php
/**
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/diije/5805069
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/diije/5805069?file=embed-gist.php
*/
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active March 12, 2025 01:22
CriticalCSS Bookmarklet and Devtool Snippet.js
(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(": ");
location /redirect/ {
rewrite ^/redirect/(.*)$ /redirect/index.php?id=$1 last;
}
["\"Deltek\"", "\"Kohler\"", "41studio", "41studio.Com", "Accessories", "Advancedwebranking", "Affermage", "Agencies", "Agency", "Ahrefs", "Ahrefs.Com", "Airconditioning", "Amawaterways", "Analytics", "Analyticsseo", "Animals", "Animation", "Architecture", "Arthur", "Arts", "As9100c", "Authoritylabs", "Avaya", "Azamara", "Bamboo", "Bandana", "Benmanns", "Billabong", "Biography", "Bloomreach", "Boots", "Brandoma", "Brewery", "Brightedge", "British", "Buddymedia", "Burgers", "Business", "Buzzstream", "Camber", "Carnival", "Ccs", "Certified", "Children", "Chimney", "Chimneys", "Classifieds", "Cleaning", "Clips", "Clothes", "Cnn", "Coal", "Coke", "Colibritool", "Comedy", "Commentkahuna", "Concerns", "Cooking", "Courier", "Courses", "Coveo", "Cranford", "Crows", "Cruise", "Cruiselines", "Cruises", "Cruising", "Cunard", "Customs", "Cybersecurity", "Data", "Deloitte", "Drysuit", "Eco", "Ecohydrology", "Ecommerce", "Edi", "Education", "Eels", "Electricals", "Elephants", "Elmo", "Emma", "England", "Entrepreneurs", "En
map $uri $blogname{
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ;
}
map $blogname $blogid{
default -999;
#Ref: http://wordpress.org/extend/plugins/nginx-helper/
#include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ;
}
@lkarsten
lkarsten / default.vcl
Last active April 23, 2021 18:32
varnish vcl for ghost blogging platform
#
# Varnish VCL file for Ghost blogging platform.
# http://ghost.org/
#
# Written for Ghost v0.3.0.
#
# This is a low-hanging-fruit type of VCL. TTL of objects are overridden to 2
# minutes, and everything below /ghost/ is pass()-ed so the user sessions
# work.
#
<!DOCTYPE html>
<html lang="en-EN">
<head>
<meta charset="UTF-8" />
<title>Test custom background &amp; header</title>
</head>
<body class="wordpress" itemscope="itemscope" itemtype="http://schema.org/WebPage">
@cliffordp
cliffordp / pagelines-dms-force-ssl-https-wp-engine.php
Last active February 12, 2017 16:38
PageLines DMS Force SSL/HTTPS
<?php
/*
Plugin Name: PageLines DMS Force SSL/HTTPS (for WP Engine)
Author: TourKick (Clifford P)
Author URI: http://tourkick.com/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmsforcessl
Plugin URI: http://www.pagelinestheme.com/pagelines-dms-ssl-https/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmsforcessl
Description: Force PageLines DMS SSL/HTTPS. <a href="http://www.pagelinestheme.com/pagelines-dms-ssl-https/" target="_blank">http://www.pagelinestheme.com/pagelines-dms-ssl-https/</a> may also be helpful.
License: GPLv2
Version: 1.2
*/
@hissy
hissy / rscsvimporter-debug.php
Last active April 6, 2020 03:24
Really Simple CSV Importer Debugger add-on
<?php
/*
Plugin Name: Really Simple CSV Importer Debugger add-on
Description: Enables to dry-run-testing with Really Simple CSV Importer. When this add-on plugin activated, csv data will not imported, just displayed on dashboard.
Author: Takuro Hishikawa
Version: 0.2
*/
class rscsvimporter_debug {
// singleton instance
@spivurno
spivurno / gw-gravity-forms-calculated-shipping.php
Last active November 19, 2021 16:51
Gravity Wiz // Gravity Forms // Calculated Shipping
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-calculated-shipping.php
*/
/**
* Gravity Wiz // Gravity Forms // Calculated Shipping
*
* A simple method for using a calculated product field as a shipping field. This provides the ability to use