Skip to content

Instantly share code, notes, and snippets.

View jonathonbyrdziak's full-sized avatar
🔥
Scaling Businesses with Marketing Technology

Jonathon Byrdziak jonathonbyrdziak

🔥
Scaling Businesses with Marketing Technology
View GitHub Profile
@jonathonbyrdziak
jonathonbyrdziak / jquery.class.js
Last active September 3, 2021 21:01
jQuery OOP Class: This allows you to easily create a class in Jquery.
/*!
* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*
* Extended by Jonathon Byrd to include function hooks
* https://gist.github.com/Jonathonbyrd/724083
*
* Don't forget your Shims!
* https://github.com/kriskowal/es5-shim/blob/master
@jonathonbyrdziak
jonathonbyrdziak / AccordionCookie.js
Created December 2, 2010 02:15
AccordionCookie: jquery accordion script, requires: jquery oop class; jquery;
/* Accordion Cookie Class
*
* This class is designed to make accordions easy.
*
*/
var AccordionCookie = Class.extend({
/**
* Default options
*/
defaults: {
@jonathonbyrdziak
jonathonbyrdziak / ad-gallery.css
Created December 6, 2010 22:51
jQuery slideshowaz
@jonathonbyrdziak
jonathonbyrdziak / Example.php
Created February 10, 2011 19:35
PayFlow Paypal Pro Payment Processing PHP Class
<?php
try {
require_once dirname(__file__).'/payflow.php';
$txn = new PayflowTransaction();
//these are provided by your payflow reseller
$txn->PARTNER = '';
$txn->USER = '';
$txn->PWD= '';
@jonathonbyrdziak
jonathonbyrdziak / identifyCredCardType.php
Created April 6, 2011 18:01
Identify a Credit Card by its number
/**
* function is responsible for returning card data, based off of the
* credit card number alone.
*
* @param unknown_type $cc_no
* @return unknown
*/
function identifyCard ($cc_no)
{ // Get card type based on prefix and length of card number
// I am sure there are smarter ways of implementing this, however due to lack of experience with regexp...
@jonathonbyrdziak
jonathonbyrdziak / currency_formatting.php
Created July 22, 2011 17:03
Working with currency and string to integers in php
<?php
/**
* Function is responsible for stripping anything out of a string value that is meant to
* be an currency amount or other float. This function then converts the numbers left
* into a float value and formatting it appropriately.
*
* @param string $string | Can be anything but mostly for $23.23
* @return float $string | returns 23.23 as a valid integer that can be used in math.
*/
function _mint( $string )
@jonathonbyrdziak
jonathonbyrdziak / homepage_layout.xml
Created August 1, 2011 18:13
Magento Homepage -> BestSellers Module for featured products
<reference name="content">
<block type="bestsellers/list" name="home.bestsellers.list" alias="product_homepage" template="catalog/product/list.phtml"/>
<!--
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
<action method="addPriceBlockType">
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
</block>
@jonathonbyrdziak
jonathonbyrdziak / local.xml
Created August 1, 2011 18:31
Custom Magento Template for 404 page
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<default>
<remove name="right.permanent.callout"/>
<remove name="left.permanent.callout"/>
</default>
</layout>
@jonathonbyrdziak
jonathonbyrdziak / wp_get_post_parent.php
Created August 11, 2011 19:12
This is a wordpress function that will return the parent of the current page.
<?php
/**
* Function is responsible for returning the parent of the current
* page.
*
* This function should be placed in your functions.php file, or equivalent
*
* @param unknown_type $post
* @return object
@jonathonbyrdziak
jonathonbyrdziak / get_taxonomy_and_terms_array.php
Created August 24, 2011 17:54
Wordpress get custom taxonomy function for loading all of the taxonomies and terms for a given post
<?php
/**
* Function is responsible for building a taxonomy/term
* array for the given post type. This array will include
* all taxonomy objects associated with the post type.
*
* This function should be preloaded, normally by placing
* it into your functions.php file.
*