Skip to content

Instantly share code, notes, and snippets.

<?php
function sumobi_edd_commissions_email_alert( $user_id, $commission_amount, $rate, $download_id, $commission_id, $payment_id ) {
global $edd_options;
/* send an email alert of the sale */
$from_name = isset( $edd_options['from_name'] ) ? $edd_options['from_name'] : get_bloginfo( 'name' );
$user = get_userdata( $user_id );
$email = $user->user_email; // set address here
@arsonus
arsonus / xss_clean.php
Last active August 29, 2015 14:22 — forked from mbijon/xss_clean.php
/*
* XSS filter
*
* This was built from numerous sources
* (thanks all, sorry I didn't track to credit you)
*
* It was tested against *most* exploits here: http://ha.ckers.org/xss.html
* WARNING: Some weren't tested!!!
* Those include the Actionscript and SSI samples, or any newer than Jan 2011
*
<?php
/**
* This class will cause WP_Query to ignore a 'post_type' parameter when 'post_type__not_in' is set.
*
* Class Post_Type__Not_In
*/
class Post_Type__Not_In {
/**
*
@arsonus
arsonus / class-search.php
Created October 16, 2015 17:19
A PHP script to search a MySQL database
<?php
/**
* Performs a search
*
* This class is used to perform search functions in a MySQL database
*
* @version 1.0
* @author John Morris <support@johnmorrisonline.com>
*/
class search {
@arsonus
arsonus / Command.php
Created November 4, 2015 02:57 — forked from drslump/Command.php
PHP Command runner class
<?php
/**
* Command building and execution
*
* Most methods implement a "fluent interface" for easy method call chaining.
*
* @see http://pollinimini.net/blog/php-command-runner/
* @author Iván -DrSlump- Montes <drslump@pollinimini.net>
* @license BSD
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Using AlloyEditor as an Angular directive</title>
<style type="text/css">
.container {
margin-left: 30px;
margin-top: 30px;
}
@arsonus
arsonus / rebuld_nginx_with_pagespeed.sh
Created March 2, 2016 21:03 — forked from gottaloveit/rebuld_nginx_with_pagespeed.sh
This is a script for Debian/ Ubuntu that will rebuild the latest Nginx deb package from nginx.org with Google Pagespeed. There are a couple other modules the script will prompt you to ask if you want to remove them. They are http-dav, http-flv, http-mp4, mail, mail_ssl. Will prompt to add http-geoip and ask if you want to change the nginx user t…
#!/bin/bash
echo "This script will rebuild a Debian style package (deb) of latest stable"
echo "Nginx. The original deb is from nginx.org apt repository."
echo
echo "This will prompt you yes or no on a few changes to the build as well as"
echo "it will compile and package the latest Google NGX Pagespeed module."
echo
echo "This is built and tested on Ubuntu 14.04 LTS, fresh OS install."
echo "There are no guarantees, and I take no liability if it breaks, but it"
@arsonus
arsonus / formatDate.js
Created March 7, 2016 04:09 — forked from cstipkovic/formatDate.js
A simple format Date function using Javascript prototype
/*
Based on Rick Strahl code
http://www.west-wind.com/weblog/posts/2008/Mar/18/A-simple-formatDate-function-for-JavaScript
Contributors:
Clauber Stipkovic - @clauberhalic
Mário Rinaldi - @MarioRinaldi
*/
Date.prototype.formatDate = function (format) {
@arsonus
arsonus / umd-script-boilerplate.js
Last active March 20, 2016 14:19 — forked from cferdinandi/umd-script-boilerplate.js
A simple boilerplate for UMD JS modules.
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
} else if ( typeof exports === 'object' ) {
module.exports = factory(root);
} else {
root.myPlugin = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {
@arsonus
arsonus / gist:903b03f0c53404127cacb134427dbecd
Created April 25, 2016 22:29 — forked from bryhal/gist:4129042
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...