I hereby claim:
- I am aaroncampbell on github.
- I am aaroncampbell (https://keybase.io/aaroncampbell) on keybase.
- I have a public key whose fingerprint is 442C 8E24 643A F2B0 1BFB 62D5 73C8 A0AF 8D6A C9C5
To claim this, I am signing this object:
<?php | |
if ( isset( $_POST['action'] ) && 'add-coupon-code' == $_POST['action'] ) { | |
if ( empty( $_POST['add_coupon_code_nonce'] ) || ! wp_verify_nonce( $_POST['add_coupon_code_nonce'], 'add_coupon_code' ) ) { | |
fc_message( "You don't have permissions to add a coupon code.", 'error' ); | |
} else { | |
$_POST['percentage'] = filter_percentage( $_POST['percentage'] ); | |
$_POST['coupon-code'] = sanitize_key( $_POST['coupon-code'] ); | |
$Promotion = new ShoppPromo(); | |
$data = array( |
#!/usr/bin/env bash | |
# Load in our options | |
while getopts "u:l:d:a" option | |
do | |
case ${option} in | |
u) url=${OPTARG};; | |
l) list_name=${OPTARG};; | |
d) list_description=${OPTARG};; | |
a) append=1;; |
<?php | |
function reverse( $arr ) { | |
$len = count( $arr ); | |
for ( $i = 0; $i < $len/2; $i++ ) { | |
list( $arr[$i], $arr[$len-$i-1] ) = array( $arr[$len-$i-1], $arr[$i] ); | |
} | |
return $arr; | |
} | |
$test = array('a', 'b', 'c', 'd', 'e'); | |
var_dump( reverse( $test ) ); |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/** | |
* Plugin Name: Background Updates for Major Releases | |
* Plugin URI: http://ran.ge/ | |
* Description: Enables background updates for major releases | |
* Version: 1.0.0 | |
* Author: Aaron D. Campbell | |
* Author URI: http://ran.ge/ | |
* License: GPLv2 or later | |
*/ |
<?php | |
/** | |
* Checks the path for the php binary and returns it's location if found | |
* | |
* @return false|string False on failure, String of binary location on success | |
*/ | |
function get_php_bin_from_path() { | |
$paths = explode( PATH_SEPARATOR, getenv( 'PATH' ) ); | |
foreach ( $paths as $path ) { | |
// Windows XAMPP sometimes has the actual bin as the path |
<?php | |
foreach ( ShoppOrder()->Cart->contents as &$item ) { | |
$item->blog_id = get_post_meta( $item->product, 'blog_id', true ); | |
} | |
function finecabin_sort_cart( $a, $b ) { | |
if ( $a->blog_id == $b->blog_id ) | |
return 0; | |
return ( $a->blog_id < $b->blog_id )? -1 : 1; | |
} |
# For patches, lower numbers are better | |
function redgreen() { | |
sed s/'^\(---\|+++\)'// | ack "^[-|\+]" -oh | sort | uniq -c | sed s/"\s*\([0-9]\+\)\s*\([+-]\)"/"\2\1"/ | xargs | awk '{print $2}{print $1}{print "--\r\n"$2 + $1}' | |
} | |
# Example usage | |
# $ svn di | redgreen | |
# +205 | |
# -506 | |
# -- |