Skip to content

Instantly share code, notes, and snippets.

View roablep's full-sized avatar

Peter Elbaor roablep

View GitHub Profile
<snippet>
<content><![CDATA[
def $1($2):
""" ${3:Description}
Args:
${2/, ?/:\n\t/g}:
Returns:
$4
<snippet>
<content><![CDATA[
Class $1(object):
""" ${2:A comprehensible explanation of the purpose of the class
that a non-programmer can understand along with advice on sub-classing.""}
Attributes:
${3/, ?/:\n\t/g}:
"""
def __init__(self, $3):
<snippet>
<content><![CDATA[
"""
${1:Description of why the classes and functions in this file are bundled together.}
"""
__author__ = "$2"
]]></content>
<snippet>
<content><![CDATA[
"""
Module: $1
Description: $2
Minimum Python Required: $3
Changelog:
import os
# Assign your top level directory to home
home = "/Users/rhancock"
for dirpath, dirs, files in os.walk(home, topdown=True):
for dr in dirs:
fullpath_d = os.path.join(dirpath, dr)
for fname in os.listdir(fullpath_d):
@roablep
roablep / polar updates
Created October 15, 2014 18:24
Polar updates for discussion
// Check to see if secondarypage has been configured
if(typeof config.configureSecondaryPage === "undefined"){
//
if(typeof window["CN"].polar.configureSecondaryPage === "undefined"){
}
}
// Cookie setter and getter functions
// We only want to count daily unique ad blocks
// Taken from www.w3schools.com/js/js_cookies.asp
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires + "; " + "path=/";
}
(function(){
'use strict';
var sites = { // all sites and site placement details
'www.allure.com' : {
slot : '.entry-content #entry-more ',
},
'arstechnica.com' : {
slot : '#teads-container',
for (var key in myd) {
if (myd.hasOwnProperty(key)) {
var siteProp = myd[key];
if (siteProp.hasOwnProperty('plugins'))
{
var pluginsProp = siteProp.plugins;
if (pluginsProp.hasOwnProperty('mobileAdInjector'))
{console.log(key, "-->" , 'Interval - ', pluginsProp.mobileAdInjector.interval, 'Max Injections - ', pluginsProp.mobileAdInjector.maxInjections);}
}
}
@roablep
roablep / services.md
Created August 2, 2017 13:26 — forked from bf4/services.md
Analytics, Metrics and Error monitoring services (and roll your own via logging, etc)