Skip to content

Instantly share code, notes, and snippets.

<?php
// Redirect new registrant after first dues payment
function wcs_redirect_product_group_based ( $order_id )
{
$order = wc_get_order( $order_id );
// $user_groups = get_all_user_meta($member->ID);
$user_meta = get_all_user_meta($member->ID);
$user_groups = $user_groups->get_user_groups();
@jlarosee
jlarosee / geo.js
Created August 28, 2016 17:26 — forked from mkhatib/geo.js
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
public static function age($date = null, $format = null)
{
if( ! $date ) return null;
list($month,$day,$year) = explode("-",$date);
$yeardiff = date("Y") - $year;
$monthdiff = date("m") - $month;
$daydiff = date("d") - $day;
@jlarosee
jlarosee / hipchat_bot.js
Created May 9, 2011 17:03 — forked from powdahound/hipchat_bot.js
Basic XMPP bot example for HipChat using node.js
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
Restart apache and test
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.