View sfmc-number-suffixes.html
%%[
var @day, @suffix
for @day = 1 to 31 do
/* set @day = Format(Now(),"dd")) */
/* adapted from http://stackoverflow.com/a/13627586/812377 */
if mod(@day,10) == 1 and mod(@day,100) != 11 then
View sfmc-lowest-of-three-numbers.html
%%[
var @num1, @num2, @num3, @lowestNum
/* force strings to be numbers */
set @num1 = add('105.54',0)
set @num2 = add('88.73',0)
set @num3 = add('106.32',0)
/* find lowest with method outlined here: http://stackoverflow.com/a/9424226/812377 */
set @lowestNum = iif(@num1 < iif(@num2 < @num3, @num2, @num3), @num1, iif(@num2 < @num3, @num2, @num3))
View SFMC-prettying-up-ampscript.html
%%[/* Modify to view AMPScript <div style="display:none"> */
/* your big blob of AMPScript goes here */
/*</div>*/
]%%
View bash-convert-mkv-to-mp4-with-avconv.sh
find ./ -name '*.mkv' -exec bash -c 'avconv -i "$1" -c:v copy -c:a copy "${1%.mkv}.mp4"' _ {} \;
View SFMC-SSJS-delete-rows-from-DE.js
<script runat="server">
Platform.Load("core", "1.1.1");
function pruneRows () {
var DERowKeys = DataExtension.Init("DEofRowKeys");
var DERowKeyRows = DERowKeys.Rows.Lookup(["ProcessedFlag"], [0], 50, "RowDate");
var returnString = "";
View SFMC-SSJS-retrieve-start-automation.js
<script runat="server">
Platform.Load("Core","1.1.1");
var automationCustomerKey = "CUSTOMERKEY-OF-AUTOMATION"
var rr = Platform.Function.CreateObject("RetrieveRequest");
Platform.Function.SetObjectProperty(rr, "ObjectType", "Automation");
Platform.Function.AddObjectArrayItem(rr, "Properties", "ProgramID");
Platform.Function.AddObjectArrayItem(rr, "Properties", "CustomerKey");
View SFMC-AMPScript-Coupon-Claiming
%%[
var @em, @couponRow, @couponCode, @rows, @row
/* include your sendable attribute/column here */
set @em = AttributeValue("emailAddr")
set @rows = LookupRows("couponCodes","EmailAddress",@em)
if rowcount(@rows) > 0 then
View SFMC-AMPScript-Upsert-Data-Extension-Row.amp
%%[
var @firstName, @lastName
set @firstName = "Scut"
set @lastName = "Farcus"
UpsertDE("My_Test_DataExtension",1,"SubscriberKey",_SubscriberKey,"FirstName",@firstName,"LastName",@lastName)
]%%
View sfmc-sql-enterprise-attributes.sql
select
a.customerID
, s.emailAddress
from EnterpriseAttributes a with (nolock)
inner join _Subscribers s with (nolock) on (s.subscriberID = a.subscriberID)
View VBScript-Move-Sent-Items-to-Inbox-in-Outlook.vbs
Function GetFolderPath(ByVal FolderPath As String) As Outlook.Folder
Dim oFolder As Outlook.Folder
Dim FoldersArray As Variant
Dim i As Integer
On Error GoTo GetFolderPath_Error
If Left(FolderPath, 2) = "\\" Then
FolderPath = Right(FolderPath, Len(FolderPath) - 2)