Skip to content

Instantly share code, notes, and snippets.

@zvineyard
zvineyard / Pipe Delimited US States
Last active March 18, 2021 16:14
Pipe delimited list of US state abbreviations.
AL|AK|AZ|AR|CA|CO|CT|DE|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY
@zvineyard
zvineyard / content_element_menu
Created December 14, 2012 22:26
TypoScript: Menu of Content Elements
temp.contentnav = CONTENT
temp.contentnav.wrap = <ul>|</ul>
temp.contentnav {
table = tt_content
select {
pidInList = this
andWhere = (sectionIndex=1 AND hidden=0 AND deleted=0)
orderBy = sorting DESC
where = colPos=0
languageField=sys_language_uid
@zvineyard
zvineyard / gist:3746612
Created September 18, 2012 23:06
CSS: Target IE9 Only
:root #element-id {
margin: 40px\9;
}
@zvineyard
zvineyard / gist:3595004
Created September 2, 2012 05:14
PHP: Barfy Old Authorize.net Procedural PHP Gateway Gross
<?php
// Settings
$post_url = "https://test.authorize.net/gateway/transact.dll";
$db_host = "localhost";
$db_user = "root";
$db_pass = "";
$db_name = "payments";
$db_table = "transaction_log";
@zvineyard
zvineyard / gist:3594939
Created September 2, 2012 05:01
PHP: Barfy Old Authorize.net Procedural PHP Gross
<?php
$required_fields = array(
'page_id' => 'page_id',
'Amount' => 'cc_amount',
'Credit Card Number' => 'cc_card_num',
'Credit Card Expiration Date' => 'cc_exp_date',
'Description' => 'cc_description'
);
@zvineyard
zvineyard / gist:3594872
Created September 2, 2012 04:41
HTML: Authorize.net Basic Form
<?php
if(isset($_POST['run'])) {
include('payment_validation.php');
}
?>
<form action="" method="post" name="payment" onsubmit="document.getElementById('submit_button').disabled = 1;">
<p><input name="page_id" type="hidden" value="4" /></p>
<p><label>First Name</label><input name="first_name" type="text" /></p>
<p><label>Last Name</label><input name="last_name" type="text" /></p>
<p><label>Comments</label><textarea name="comments"></textarea></p>
@zvineyard
zvineyard / gist:3594863
Created September 2, 2012 04:37
SQL: Transaction Log for authorize.net
CREATE TABLE IF NOT EXISTS `transaction_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL,
`response_code` int(11) NOT NULL,
`payment_data` text NOT NULL,
`response_data` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
@zvineyard
zvineyard / html_form
Created August 30, 2012 15:29
PHP: Upload and Rename File
<form action="" enctype="multipart/form-data" method="post">
<input id="file" name="file" type="file" />
<input id="Submit" name="submit" type="submit" value="Submit" />
</form>
@zvineyard
zvineyard / required_typoscript
Created August 23, 2012 03:35
TypoScript: Get Query String Parameter
categorySelection = TEXT
categorySelection.data = GPvar : cat
@zvineyard
zvineyard / gist:3361675
Created August 15, 2012 17:12
WordPress: Exclude posts if they are only tagged in a single category (Plugin)
<?php
/*
Plugin Name: Exclude Posts if in Single Category
Description: Exclude posts if they are only tagged in a single category, as defined by the category number. This will show posts in the loop if they are tagged in more than one category.
Version: 1.0
Author: Zac Vineyard
Author URI: http://www.zacvineyard.com
*/