Skip to content

Instantly share code, notes, and snippets.

View roablep's full-sized avatar

Peter Elbaor roablep

View GitHub Profile

Keybase proof

I hereby claim:

  • I am roablep on github.
  • I am roablep (https://keybase.io/roablep) on keybase.
  • I have a public key ASAFLStRIGrP_ANzk8TWSnCUK97vv3zr0XugYrKHzopywgo

To claim this, I am signing this object:

@roablep
roablep / pipenv.sh
Created March 5, 2018 01:54 — forked from rosswd/pipenv.sh
Using pip, virtualenv and/or virtualenvwrapper to manage packages and environments in python.
# know what version of python you have
python # os (2.7.10)
python2 # homebrew python 2 (2.7.14)
python3 # homebrew python 3 (3.6.2)
# install pipenv
pip3 install pipenv
export PATH=$PATH:$HOME/Library/Python/3.6/bin >> ~/.bash_exports
# use
@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)
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);}
}
}
(function(){
'use strict';
var sites = { // all sites and site placement details
'www.allure.com' : {
slot : '.entry-content #entry-more ',
},
'arstechnica.com' : {
slot : '#teads-container',
// 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=/";
}
@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"){
}
}
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):
<snippet>
<content><![CDATA[
"""
Module: $1
Description: $2
Minimum Python Required: $3
Changelog:
<snippet>
<content><![CDATA[
"""
${1:Description of why the classes and functions in this file are bundled together.}
"""
__author__ = "$2"
]]></content>