Skip to content

Instantly share code, notes, and snippets.

View cougrimes's full-sized avatar

Casey Grimes cougrimes

View GitHub Profile
@cougrimes
cougrimes / marketo_default_activity_types.json
Last active December 21, 2022 18:38
This is a reference for the default Marketo activity schema deployed to instances. Never run a call just to remember what activity type "send alert" is again!
{
"requestId":"this sure is fake",
"result":[
{
"id":1,
"name":"Visit Webpage",
"description":"User visits a web page",
"primaryAttribute":{
"name":"Webpage ID",
"dataType":"integer"
@cougrimes
cougrimes / monospace.gs
Created December 11, 2020 19:29
A Google Apps script for creating custom monospace styles in documents. Pair with a macro editor to use as a keyboard shortcut!
/* Welcome to monospace.gs, a script that handles standardizing formatting for items
needing monospace formatting in documents. Note that if you are wanting to share
large code blocks, you likely should install the following add-on:
https://workspace.google.com/marketplace/app/code_blocks/100740430168
This plugin is meant more for psuedocode and inline markup of code elements in
documentation. Use https://www.autocontrol.app/ to assign a keyboard shortcut for
the script's behavior. Enjoy! */
// Add new menu item
@cougrimes
cougrimes / lib-singlepageapp.js
Last active September 10, 2020 17:03
I got frustrated by the lack of more intuitive single-page app tracking in Tealium and wrote a hacky workaround. Use at your own discretion.
/* Welcome to lib-singlepageapp.js! This script is meant to handle using single-page
applications (SPAs) for Tealium when you do not have direct access to Angular, Vue,
React, etc. for making modifications. This allows us to get around limitations of
utag.view(). The trigger in this case is a global event listener that evaluates
any time there is a click, HTML5 history API replacement, load event, or DOMContentLoaded
event. If a new URL is populated via the history API, we'll treat that as a "pageview".
Note in this case that I have defined a UDO variable of page. This variable is then mapped
to anything requiring a page URL. For example, in GA I have this variable mapped to
config.page_location so it acts like a native page URL view.*/
@cougrimes
cougrimes / csv-splitter.sh
Last active September 5, 2018 17:51
CSV Splitter. Use as ./csv-splitter.sh [your_csv_filename] [number_of_lines_to_split_into]
#!/bin/bash
FILENAME=$1
FILESIZE=$(stat -c%s "$FILENAME")
FILELINES=$(wc -l < $FILENAME)
SPLITRATIO=$(($FILESIZE / 9500000))
[ -z "$2" ] && LINES=$(($FILELINES / $SPLITRATIO)) || LINES=$2
TRIM="${FILENAME:0:${#FILENAME}-4}"
HDR=$(head -1 $FILENAME)
split -l $LINES $FILENAME xyz
@cougrimes
cougrimes / marketo-form-confirmation.html
Created October 20, 2017 20:41
Show message on same page after successful form submission.
<div class="container">
<script src="//app-abc.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_27"></form>
<script>MktoForms2.loadForm("//app-abc.marketo.com", "123-ABC-456", 1);</script>
<div id="confirmation" aria-hidden="true" style="display:none;">
<p>This is a sample thank you message. Thanks for viewing.</p>
</div>
</div>
<script>
MktoForms2.whenReady(function (form){
@cougrimes
cougrimes / marketo-form-ga.js
Created October 20, 2017 20:29
Send Google Analytics event on Marketo form submission
MktoForms2.whenReady(function(form) {
form.onSuccess(function(vals, page) {
ga('send', 'event', {
eventCategory: 'Marketo Form',
eventAction: 'Form Submission',
eventLabel: formName,
hitCallback: function() {
document.location.href = page;
};
});
@cougrimes
cougrimes / velocity-marketo-npp.xml
Created July 3, 2017 17:29
Velocity syntax highlighting for Notepad++, Marketo-specific
<NotepadPlus>
<UserLang name="Velocity" ext="vm" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="yes" Keywords3="yes" Keywords4="yes" Keywords5="yes" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">03#* 04*# 00## 01 02</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
MktoForms2.whenReady(function (form){
var domains = ["aol.com", "att.net", "comcast.net", "facebook.com", "gmail.com", "gmx.com", "googlemail.com","google.com", "hotmail.com", "hotmail.co.uk", "mac.com", "me.com", "mail.com", "msn.com","live.com", "sbcglobal.net", "verizon.net", "yahoo.com", "yahoo.co.uk", "email.com", "games.com", "gmx.net", "hush.com", "hushmail.com", "icloud.com", "inbox.com","lavabit.com", "love.com" , "outlook.com", "pobox.com", "rocketmail.com" ,"safe-mail.net", "wow.com", "ygm.com", "ymail.com" , "zoho.com", "fastmail.fm","yandex.com","iname.com","bellsouth.net", "charter.net", "cox.net", "earthlink.net", "juno.com","btinternet.com", "virginmedia.com", "blueyonder.co.uk", "freeserve.co.uk", "live.co.uk","ntlworld.com", "o2.co.uk", "orange.net", "sky.com", "talktalk.co.uk", "tiscali.co.uk","virgin.net", "wanadoo.co.uk", "bt.com", "sina.com", "qq.com", "naver.com", "hanmail.net", "daum.net", "nate.com", "yahoo.co.jp", "yahoo.co.kr", "yahoo.co.id", "yahoo.co.in", "yahoo.com.sg", "yahoo.c
@cougrimes
cougrimes / grid-only.css
Created May 2, 2017 19:58
Bootstrap 4, Grid Only, Compiled
.container {
margin-left: auto;
margin-right: auto;
padding-left: 15px;
padding-right: 15px;
}
.container::after {
content: "";
display: table;
clear: both;