Skip to content

Instantly share code, notes, and snippets.

View shawncreed's full-sized avatar

Shawn C. Reed shawncreed

  • Atlanta, GA
View GitHub Profile
@shawncreed
shawncreed / adobe_launch_target_prehide.html
Created July 11, 2019 20:11
Pre-hide the DOM for Adobe Launch asynchronous deployment to prevent flicker with Adobe Target
<script>
//prehiding snippet for Adobe Target with asynchronous Launch deployment
(function(g,b,d,f){(function(a,c,d){if(a){var e=b.createElement("style");e.id=c;e.innerHTML=d;a.appendChild(e)}})(b.getElementsByTagName("head")[0],"at-body-style",d);setTimeout(function(){var a=b.getElementsByTagName("head")[0];if(a){var c=b.getElementById("at-body-style");c&&a.removeChild(c)}},f)})(window,document,"body {opacity: 0 !important}",3E3);
</script>
@shawncreed
shawncreed / dtm_quick_reject.js
Created April 17, 2019 20:45
Copy and paste into browser console for quick rejection of the current DTM rule in the approvals queue. (Reject a bunch quickly by using Ctrl+V followed by Enter repeatedly!)
(function() {
var rejectType = 2; // 1 for reject and retain changes, 2 for reject and restore approved version
var rejectReason = "Update not needed; preparing for Launch migration";
/* Don't edit below this line */
$("#toolbar > a.button.destruct.modal_trigger").trigger("click");
setTimeout(function() {
$("#modal_target_reject > form > fieldset:nth-child(3) > ul > li:nth-child(rejectType) > label").trigger("click");
setTimeout(function() {
$("#rejection_reason")[0].innerText = rejectReason;
@shawncreed
shawncreed / setcookie.example.html
Last active March 18, 2019 18:37
Example of page using image pixel to send data to another server to be set in a cookie
<html>
<head>
<title>Set cookie example</title>
</head>
<body>
<h1>Set cookie example</h1>
This is a page on the site where the cookie is already available.
<script language="javascript">
/* This is where our data layer is being set */
digitalData = {
@shawncreed
shawncreed / setcookie.example.php
Created March 18, 2019 18:14
Server-side script to allow input of a value that will then be set in a cookie. Useful for passing values between domains where cookie sharing would otherwise be impossible.
<?php
$hash = $_GET["userid"];
setcookie("userid", $hash, time()+60*60*24*30, "/", ".mybank.com");
header("Content-Type: image/gif");
echo base64_decode('R0lGODlhAQABAJAAAP8AAAAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw==');
@shawncreed
shawncreed / .gitignore
Created March 29, 2018 21:13 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@shawncreed
shawncreed / byedots.sh
Created November 3, 2017 21:52
Remove all files from a given directory (and its entire subtree) based on pattern
#!/bin/sh
pattern="._*"
if [ -z "$1" ]
then
echo "\n Usage: byedots <start directory>\n Example: byedots . (for current directory)";
exit 0;
fi