Skip to content

Instantly share code, notes, and snippets.

@dovy
dovy / gist:b98c2668a40822d1328b
Created August 11, 2015 17:40 — forked from ultimatemember/gist:48bf0a269af5d182ad9b
EDD Open Metrics: Show various sale stats
// Avg downloads per customer
function sc_edd_avg_downloads_per_customer( $atts ) {
$amount = 0;
$query = new WP_Query( array( 'post_type' => 'download' ) );
foreach( $query->posts as $post ) {
$amount = $amount + edd_get_download_sales_stats( $post->ID );
}
$amount = $amount / edd_count_total_customers();
return number_format( $amount, 2 );
}
@dovy
dovy / gist:c55cf5f76a429db25457
Created August 11, 2015 17:39 — forked from ultimatemember/gist:afb94c5b66c63a34d3c1
EDD Open Metrics: Show recent payments
// recent payments
function sc_edd_recent_payments( $atts ) {
$p_query = new EDD_Payments_Query( array(
'number' => 12,
'status' => 'publish'
) );
$payments = $p_query->get_payments();

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@dovy
dovy / Sendy.md
Last active January 12, 2022 19:50 — forked from danielepolencic/Sendy.md

Sendy

Sendy is a self hosted email newsletter application that lets you send trackable emails via Amazon Simple Email Service (SES).

Heroku

You can deploy Sendy on Heroku using the following instructions (I assume you've already installed the heroku toolbelt).

  1. On Heroku, create a new app.
  2. Clone that app to your desktop
@dovy
dovy / 0_reuse_code.js
Created January 31, 2014 22:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/*
* The page core options for the Shoestrap theme
*/
if ( !function_exists( 'shoestrap_module_coulourlovers_options' ) ) :
function shoestrap_module_coulourlovers_options( $sections ) {
// Page Options