Skip to content

Instantly share code, notes, and snippets.

@kylekeesling
kylekeesling / Old TableSorter Indicators
Created November 24, 2011 19:50
Incorporate Bootstrap Styling into Sortable Table Helper
Link to older version of the asset on github:
https://github.com/twitter/bootstrap/raw/96c3e709963516a06ad6e723a7bba3fbf5fc1ba2/assets/img/tablesorter-indicators.png
@kylekeesling
kylekeesling / unsub_unengage_subs.js
Created April 11, 2012 18:04
ExactTarget - Self-Cleansing List - Unengaged Subscribers
<script runat="server" language="javascript">
Platform.Load("Core","1");
//Self-Cleansing List
var selfCleansinglist = List.Init("auto_cleansing_list");
var status;
//Newly Refreshed Group that Contains Unengaged Subscribers
var unengagedGroup = List.Init('unengaged_subscribers_group');
@kylekeesling
kylekeesling / ssjs.js
Created April 20, 2012 16:05
Using Portuguese in SSJS
<script runat="server" language="javascript">
Platform.Load("Core","1");
var requestsDE = DataExtension.Init("bz-solcon-requests");
var triggeredSend = TriggeredSend.Init("bsrf");
requestsDE.Rows.Add({
repName: Request.GetFormField('repName'),
companyName: Request.GetFormField('companyName'),
@kylekeesling
kylekeesling / already-sent-to.sql
Created December 14, 2012 20:49
Query that uses ExactTarget Data Views to find all subcribers who've been sent to today. Also includes an optional qualifier to ignore emails that you may use on a seed list
SELECT DISTINCT
SubscriberKey
FROM _Sent
WHERE
DATEDIFF(day, EventDate, GETDATE()) = 0
AND SubscriberKey NOT IN ('email1@et.com','email2@et.com''email3@et.com')
@kylekeesling
kylekeesling / form.html
Created December 19, 2012 18:09
Example of an ExactTarget Landing Page that logs form submissions to a Data Extension and then kicks off a Triggered Send to the submitter. This example also leverages ExactTarget's server-side javascript library. More info and documentation can be found here - http://wiki.memberlandingpages.com/010_ExactTarget/020_Content/Server-Side_JavaScript
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>
SolCon Request Form
</title>
<!-- HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
@kylekeesling
kylekeesling / add_data_to_de.php
Last active December 28, 2019 03:31
Example of Adding Data to an ExactTarget Data Extension via the SOAP API - API Starter Kit can be found here - http://docs.code.exacttarget.com/@api/deki/files/199/=PHP_APIstarterKit-V1.zip
<?
public function dataExtensionAdd($ExternalKey = '', $client = '') {
try {
/* Create the Soap Client */
$soap = new EBG_ExactTarget_Client($this->wsdl, array('trace'=>1));
/* Set username and password here */
$soap->username = $this->username;
$soap->password = $this->password;
@kylekeesling
kylekeesling / example.html
Created January 18, 2013 19:50
How to use the jQuery Cookie plugin
<!doctype html>
<html>
<head>
<title>Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<!-- Available here: https://github.com/carhartl/jquery-cookie -->
<script src="jquery.cookie.js"></script>
</head>
<body>
<script>
@kylekeesling
kylekeesling / geo-target.sql
Created February 21, 2013 17:03
GeoTargeting SQL for 15km Radius of Zip Code 46254
SELECT
myData.*,
ROUND(6378.137 * ACOS(
CASE
WHEN (SIN(RADIANS((SELECT latitude FROM [Zip Codes and Locations] where [Zip Code] = 46254))) * SIN(RADIANS(geo.Latitude))) + (COS(RADIANS((SELECT latitude FROM [Zip Codes and Locations] where [Zip Code] = 46254))) * COS(RADIANS(geo.Latitude)) * COS(RADIANS(geo.Longitude) - RADIANS((SELECT longitude FROM [Zip Codes and Locations] where [Zip Code] = 46254)))) > 1 THEN 1
WHEN (SIN(RADIANS((SELECT latitude FROM [Zip Codes and Locations] where [Zip Code] = 46254))) * SIN(RADIANS(geo.Latitude))) + (COS(RADIANS((SELECT latitude FROM [Zip Codes and Locations] where [Zip Code] = 46254))) * COS(RADIANS(geo.Latitude)) * COS(RADIANS(geo.Longitude) - RADIANS((SELECT longitude FROM [Zip Codes and Locations] where [Zip Code] = 46254)))) < -1 THEN -1
ELSE (SIN(RADIANS((SELECT latitude FROM [Zip Codes and Locations] where [Zip Code] = 46254))) * SIN(RADIANS(geo.Latitude))) + (COS(RADIANS((SELECT latitude FROM [Zip Codes and Locations] where [Zip Code] = 4
@kylekeesling
kylekeesling / paginator.html
Created October 31, 2013 12:35
Simple Jekyll Paginator Logic I didn't like the pagination logic provided in the Jekyll Docs (http://jekyllrb.com/docs/pagination/) since it repeated the HTML for displaying the button, so I came up w/ this. It stores the proper previous page path into a liquid variable then plops it into the HREF so you only have to code your button once
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
{% capture previous_page %}/{% endcapture %}
{% else %}
{% capture previous_page %}/page{{ paginator.previous_page }}{% endcapture %}
{% endif %}
<a href="{{ previous_page }}" class="previous">&larr; Newer Posts</a>
{% endif %}
{% if paginator.next_page %}
@kylekeesling
kylekeesling / kyles_super_cool_pdf.rb
Created November 15, 2013 03:07
How to Generate a Prawn PDF class with a repeating footer
class KylesSuperCoolPdf < Prawn::Document
def initialize
super()
repeat :all do
#Create a bounding box and move it up 18 units from the bottom boundry of the page
bounding_box [bounds.left, bounds.bottom + 18], width: bounds.width do
text "Probably the Best Footer Ever", size: 8, align: :center
end