Skip to content

Instantly share code, notes, and snippets.

View dubrod's full-sized avatar

Wayne Roddy dubrod

View GitHub Profile
@dubrod
dubrod / Run a PHP or jQuery Function after jQuery UI Dialog Confirmation
Created August 23, 2013 17:08
Run a PHP or jQuery Function after jQuery UI Dialog Confirmation. You can read the supporting article at : https://www.revitalagency.com/blog/run-a-php-or-jquery-function-after-jquery-ui-dialog-confirmation/
<script>
$(function() {
//run function after jquery dialong confirm
//step 1 - the action
$(".deleteBtn").click(function(e) {
e.preventDefault();
pid = $(this).attr("title"); // the id of the photo i want to delete
//console.log($(this).attr("title")); // check you get it first
@dubrod
dubrod / jQuery Over 21 Dialog Checker
Last active January 25, 2016 14:09
Completely jQuery Over 21 Dialog Check
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Over 21 script</title>
<style type="text/css">
#ageCheckWrapper{
@dubrod
dubrod / Commonly Used Content Tags in MODX
Created February 3, 2016 19:38
Commonly Used Content Tags in MODX used in my Public Snapshots
[[$header]]
<h1>[[*longtitle]]</h1>
[[*content]]
[[$footer]]
@dubrod
dubrod / Commonly Used Context Variable Examples
Created February 3, 2016 20:30
Commonly Used Context Variable Examples for use in my Public Snapshots
<footer>
<h3>[[++site_name]]</h3>
<p>[[++site_desc]]</p>
<h3 class="mt1">Phone</h3>
<p>[[++site_phone]]</p>
<small class="m1">[[++site_copyright]]</small>
</footer>
@dubrod
dubrod / TWEET2COUPON
Created August 30, 2011 14:18
Translate # of Twitter Followers to Discount Coupon % on osCommerce
<?php
$tweet_data = json_decode(file_get_contents("http://api.twitter.com/1/users/show.json?screen_name=YOURTWITTERNAME"), true);
// display tweet data array ( just to show you i know what i'm doing =] )
//print "<pre>";
//print_r($tweet_data);
//print "</pre>";
@dubrod
dubrod / FQL2COUPONCODE
Created February 14, 2011 18:54
Using the new FQL (Facebook) we pull # of Likes of a company page, make it a %, and insert it into osCommerce for a Coupon Code.
<?php
// must have http://addons.oscommerce.com/info/4269 installed in your osCommerce
$fb_data = json_decode(file_get_contents("https://graph.facebook.com/ACCESS-TOKEN-HERE"), true);
// ACCESS TOKEN FOR YOUR PAGE OR PROFILE
// See http://developers.facebook.com/docs/reference/api - Once a user has granted your application the "manage_pages" permission, the "accounts" connection will yield an additional access_token property for every page administrated by the current user.
// used for debugging/install
// print "<pre>";
@dubrod
dubrod / MODX - Register Quickstart
Last active June 1, 2016 14:42
MODX - Register Quickstart
[[!Register?
&submittedResourceId=`1`
&validate=`
fullname:required,
email:email:required,
username:required:minLength=^6^,
password:required:minLength=^6^
`
]]
@dubrod
dubrod / Not a full script - pieces of example
Created June 1, 2016 18:02
MODX - Register - DOB done on Frontend
<section>
<label>Birth Date </label>
<select id="birthMonth">
<option value="0">January</option>
<option value="1">February</option>
<option value="2">March</option>
<option value="3">April</option>
<option value="4">May</option>
<option value="5">June</option>
<option value="6">July</option>
@dubrod
dubrod / modx-active-users-plus-extended-fields-snippet
Created July 6, 2016 14:28
Get MODX Active Users and Create a Table based on Extended Fields
//SNIPPET
$year = date("Y");
$jerseyYS = 0;
$jerseyYM = 0;
$jerseyYL = 0;
$jerseyYXL = 0;
$jerseyAS = 0;
$jerseyAM = 0;
$jerseyAL = 0;
@dubrod
dubrod / modx-user-dob-table
Last active July 6, 2016 20:04
Display a Table Count of Users by DOB
//SNIPPET
$datearr = [];
$users = $modx->getIterator('modUser', array('active'=>'1'));
foreach ($users as $user) {
$profile = $user->getOne('Profile');
$dob = date("Y", $profile->get('dob'));