Skip to content

Instantly share code, notes, and snippets.

View patrick-mcdougle's full-sized avatar
🙃
Probably Thinking About Code

Patrick McDougle patrick-mcdougle

🙃
Probably Thinking About Code
View GitHub Profile
@patrick-mcdougle
patrick-mcdougle / index.php
Created July 17, 2020 03:29
Reads a CSV of IMDB List Data and outputs a .ics compatible data for their 25x anniversaries
<?php // PHP >= 7.1 (because of the ical library used)
// Autoload file comes from composer
require_once __DIR__.'/../vendor/autoload.php';
// composer require eluceo/ical
// https://packagist.org/packages/eluceo/ical
use Eluceo\iCal\Component\Calendar;
use Eluceo\iCal\Component\Event;
@patrick-mcdougle
patrick-mcdougle / pbjs.js
Last active May 23, 2017 02:06
PBJS Proposed Change
...
function r(e, o) {
pbjs.initAdserverSet = !0,
pbjs.requestBids({
adUnits: d(e),
bidsBackHandler: function() {
googletag.cmd.push(function() {
pbjs.setTargetingForGPTAsync(),
if (typeof o !== 'undefined') {
window.googletag.pubads().refresh(p(e), o)
@patrick-mcdougle
patrick-mcdougle / gpt-js.tpl
Created April 12, 2017 00:39
Gallery Page Ads Code
//Setup Amazon
var amznads = amznads || {};
amznads.asyncParams = {
'id': '3217',
'callbackFn': function() {
try {
amznads.setTargetingForGPTAsync('amznslots');
} catch (e) {}
},
@patrick-mcdougle
patrick-mcdougle / context.js
Last active March 6, 2017 20:55
Waypoint DOM removal detection
...
/* Public */
/* http://imakewebthings.com/waypoints/api/context-refresh */
Context.prototype.refresh = function() {
/*eslint-disable eqeqeq */
var isWindow = this.element == this.element.window
/*eslint-enable eqeqeq */
var contextOffset = isWindow ? undefined : this.adapter.offset()
var triggeredGroups = {}
var axes
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce={{ csp_script_nonce }}{% endif %}>/*<![CDATA[*/
{# Caution: the contents of this file are processed by Twig before loading
them as JavaScript source code. Always use '/*' comments instead
of '//' comments to avoid impossible-to-debug side-effects #}
Sfjs = (function() {
"use strict";
var classListIsSupported = 'classList' in document.documentElement;