Skip to content

Instantly share code, notes, and snippets.

@stevesmename
stevesmename / aaa_quickfinder.js
Created August 3, 2012 16:52
Special params that set min/max dates with date_popup
(function($) {
$(document).ready(function() {
var hotel_dates = $( "#hotel-checkin, #hotel-checkout" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
dateFormat: "mm/dd/yy",
autoSize: true,
onSelect: function( selectedDate ) {
@stevesmename
stevesmename / manage_comments_keyword-search.views.inc
Created August 27, 2012 14:59
Comment Dashboard that shows comments by keyword search. Works for any Drupal 7 environment.
$view = new view;
$view->name = 'manage_comments_keyword_search';
$view->description = 'Comment Dashboard that shows comments by keyword search.';
$view->tag = 'default';
$view->base_table = 'comment';
$view->human_name = 'Comments: Keyword Search';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@stevesmename
stevesmename / colorbox-example.htm
Created August 27, 2012 15:29
Colorbox integration example.
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="https://www.aaa.com/aaa/002/wrapper/colorbox/jquery.colorbox-min.js"></script>
<script>
$(document).ready(function(){
$(".colorbox").colorbox({iframe:true, width:"980px", height:"80%"});
});
@stevesmename
stevesmename / gist:3713541
Created September 13, 2012 10:49
Drupal 6.x Uninstall method for best removing variables.
function hook_uninstall() {
// Remove module variables.
$result = db_query("SELECT name FROM {variable} WHERE name LIKE 'hook_%'");
while ($var_name = db_result($result)) {
variable_del($var_name);
}
}
@stevesmename
stevesmename / exacttarget_soap_client.php
Created September 13, 2012 11:37
This build of the exacttarget soap client was done on 06/01/2011
<?php
require('soap-wsse.php');
class ExactTargetSoapClient extends SoapClient {
public $username = NULL;
public $password = NULL;
function __doRequest($request, $location, $saction, $version) {
$doc = new DOMDocument();
$doc->loadXML($request);
$objWSSE = new WSSESoap($doc);
$objWSSE->addUserToken($this->username, $this->password, FALSE);
@stevesmename
stevesmename / settings-snippet.php
Created September 13, 2012 15:01 — forked from kellybell/settings.php redirect for Pantheon sites
Pantheon settings.php URL normalizing code - rewrites www.sitename.com (and othersubdomains.sitename.com) to sitename.com
$primary_domain = 'mountainwest.aaa.com';
$primary_schema = 'http://';
$live_subdomain = 'www.';
$test_subdomain = 'test.';
$live_domain = $live_subdomain . $primary_domain;
if (isset($_SERVER['PANTHEON_ENVIRONMENT']) &&
$_SERVER['PANTHEON_ENVIRONMENT'] === 'test') {
$base_url = $primary_schema . $test_subdomain . $primary_domain;
}
<?php
/**
* @file
* Functions that need to be loaded on every Drupal request.
*/
/**
* The current system version.
*/
@stevesmename
stevesmename / nationalsurvey.htm
Created October 1, 2012 16:31
TQS4 Survey onClick
<html>
<head>
<title>AAA Website Survey</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body background="images/bbg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-Include javascript for counting invitation. If page not hosted on aaa.com, change path to http://www.aaa.com/configuration/CountSurvey.js-->
<script language=javascript src='http://www.aaa.com/configuration/CountSurvey.js'></script>
<!-- Start of content section. -->
@stevesmename
stevesmename / gist:3998658
Created November 2, 2012 04:06
AAAMETRICS - AAA Arizona Main
<script type="text/javascript">
<!--//--><![CDATA[//><!--
AAAMETRICS = function() { return {"club":"aaa-az","partner":"main",svars:{"partner":"main"}} }();(function() {var ss = document.createElement("script");ss.type = "text/javascript";ss.async = true;ss.src = ('https:'== document.location.protocol ? 'https://' : 'http://') + 'metrics.go.aaa.com/ss/ss.js';var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(ss, s);})();
//--><!]]>
</script>
function some_extensive_process () {
// ... your intense code here
if (function_exists('newrelic_ignore_apdex')) {
newrelic_ignore_apdex(TRUE);
}
}