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
export enum NmiResponse { | |
Approved = '1', | |
Declined = '2', | |
Errored = '3' | |
} | |
// ref: http://www.noblepay.com/pdf/NMI_Direct_Post_API(19).pdf | |
export const NmiResponseCode = { | |
'100': 'transaction was approved', | |
'200': 'transaction was declined by processor', |
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
/** | |
* Removes the value ›nofollow‹ from the rel attribute. | |
*/ | |
function xwp_dofollow($str) | |
{ | |
$str = preg_replace( | |
'~<a ([^>]*)\s*(["|\']{1}\w*)\s*nofollow([^>]*)>~U', | |
'<a ${1}${2}${3}>', $str); | |
return str_replace(array(' rel=""', " rel=''"), '', $str); | |
} |
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 | |
/** | |
* Retrieve a page given its slug. | |
* | |
* @global wpdb $wpdb WordPress database abstraction object. | |
* | |
* @param string $page_slug Page slug | |
* @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. | |
* Default OBJECT. | |
* @param string|array $post_type Optional. Post type or array of post types. Default 'page'. |
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 | |
/** | |
* Get Vimeo video id from url | |
* | |
* Supported url formats - | |
* | |
* https://vimeo.com/11111111 | |
* http://vimeo.com/11111111 |
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 | |
add_action('admin_init', 'add_meta_boxes', 1); | |
function add_meta_boxes() { | |
add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high'); | |
} | |
function repeatable_meta_box_display() { | |
global $post; |
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 | |
/* | |
* Dynamically Generated Checkboxes in a WordPress Settings Page | |
* | |
* This file is fully functional and ready to be used in a plugin or theme to generate this Settings Page | |
* | |
*/ | |
Class Pizza_Shop { |
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
SELECT p.`ID`, | |
p.`post_title` AS coupon_code, | |
p.`post_excerpt` AS coupon_description, | |
Max(CASE WHEN pm.meta_key = 'discount_type' AND p.`ID` = pm.`post_id` THEN pm.`meta_value` END) AS discount_type, -- Discount type | |
Max(CASE WHEN pm.meta_key = 'coupon_amount' AND p.`ID` = pm.`post_id` THEN pm.`meta_value` END) AS coupon_amount, -- Coupon amount | |
Max(CASE WHEN pm.meta_key = 'free_shipping' AND p.`ID` = pm.`post_id` THEN pm.`meta_value` END) AS free_shipping, -- Allow free shipping | |
Max(CASE WHEN pm.meta_key = 'expiry_date' AND p.`ID` = pm.`post_id` THEN pm.`meta_value` END) AS expiry_date, -- Coupon expiry date | |
Max(CASE WHEN pm.meta_key = 'minimum_amount' AND p.`ID` = pm.`post_id` THEN pm.`meta_value` END) AS minimum_amount, -- Minimum spend | |
Max(CASE WHEN pm.meta_key = 'maximum_amount' AND p.`ID` = pm.`post_id` THEN pm.`meta_value` END) AS maximum_amount, -- Maximum spend | |
Max(CASE WHEN pm.m |
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
/* | |
* Exit Popup | |
* Exit Popup enabling you to display a modal before a user leaves your website | |
* | |
*/ | |
(function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(require, exports, module); |
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
# my.cnf for TAKIS Server | |
# BEGIN CONFIG INFO | |
# DESCR: 8 GB RAM, InnoDB only, ACID, few connections, heavy queries | |
# TYPE: SYSTEM | |
# END CONFIG INFO | |
[client] | |
port = 7000 | |
socket = /var/lib/mysql/mysql.sock |
NewerOlder