Skip to content

Instantly share code, notes, and snippets.

View davinian's full-sized avatar

David Churchill davinian

View GitHub Profile
@davinian
davinian / functions.php
Created October 31, 2018 14:46 — forked from vivek-kumar-poddar/functions.php
This is an updated version of social media buttons. This code snippet will help you to add social media buttons to your website without even using any plugin. Furthermore it's javascript free. Enjoy fast speed and the same usability. For more details visit the official post: https://wpvkp.com/add-social-media-sharing-buttons-to-wordpress-without…
// Function to handle the thumbnail request
function get_the_post_thumbnail_src($img)
{
return (preg_match('~\bsrc="([^"]++)"~', $img, $matches)) ? $matches[1] : '';
}
function wpvkp_social_buttons($content) {
global $post;
if(is_singular() || is_home()){
// Get current page URL
@davinian
davinian / gist:a5a6ca893dab447dba2a9e93bd820465
Created October 4, 2018 09:02 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@davinian
davinian / gw-coupons-exclude-products.php
Created January 17, 2017 16:26 — forked from spivurno/gw-coupons-exclude-products.php
Gravity Wiz // Gravity Forms Coupons // Exclude Products from Coupon Discount
<?php
/**
* Gravity Wiz // Gravity Forms Coupons // Exclude Products from Coupon Discount
*
* Exclude specific products when calculating discounts with the Gravity Forms Coupons add-on.
*
* Requires Gravity Forms Coupons v1.1
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
@davinian
davinian / about:config.md
Created August 19, 2016 15:17 — forked from haasn/about:config.md
Firefox bullshit removal via about:config

Firefox bullshit removal

Due to the incessant swarm of complete and utter nonsense that has been forcing its way into Firefox over time, I've decided to start collecting my personal list of “must-have” about:config tweaks required to turn Firefox into a functional brower.

NOTE: Unfortunately this is somewhat out of date. The comments link to some resources that may be more up-to-date. Patches welcome.

WebSockets

These can be used for nefarious purposes and to bypass access restrictions.

<?php
/*
Template Name: Print Processing Orders :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />