Skip to content

Instantly share code, notes, and snippets.

import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
/*
*
* Very basic Client Lib for Push.co
* Send Push notifications to your iPhone from AdWords Scripts
*
* @author Victor Kaugesaar, kaugesaar@gmail.com
* Version 1.0
*
* With inspiration from:
* http://www.freeadwordsscripts.com/2014/01/make-calls-and-send-text-messages-to.html
function euclidean(p1, p2) {
var s = 0;
for (var i = 0, l = p1.length; i < l; i++) {
s += Math.pow(p1[i] - p2[i], 2)
}
return Math.sqrt(s);
}
function calculateCenter(points, n) {
var vals = []
/*
*
* Sortera Close Variants med Levenshtein Distance
*
* Levenshtein Distance i korthet = antal tecken du
* måste ändra för att kunna skapa två lika strängar.
*
* För mer info: http://en.wikipedia.org/wiki/Levenshtein_distance
*
*/
function getLevenshteinDistance(a, b) {
if(a.length === 0) return b.length;
if(b.length === 0) return a.length;
var matrix = [];
var i;
for(i = 0; i <= b.length; i++){
matrix[i] = [i];
}
<?php
class GeoSearch {
/**
* Base URL for Google
*
* @var string
*/
public $baseUrl = 'https://www.google.se/search?';
@kaugesaar
kaugesaar / demo.js
Created April 29, 2015 18:05
Add thousand separators with regex
var budget = "12381298198";
budget.replace(/(^|[^0-9.])([0-9]{4,})/g, function($0, $1, $2) {
return $1 + $2.replace(/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g, "$& ");
});
@kaugesaar
kaugesaar / Search Query Mining Tool.js
Last active September 1, 2015 12:38 — forked from BrainlabsDigital/Search Query Mining Tool.js
Search Query Mining Tool script to calculate the performance of n-grams
/**
*
* Search Query Mining Tool
*
* This script calculates the contribution of each word or phrase found in the
* search query report and outputs a report into a Google Doc spreadsheet.
*
* Version: 2.0
* Google AdWords Script maintained by brainlabsdigital.com
*
if(! Date.toAdWordsString) {
Date.prototype.toAdWordsString = function () {
var y = String(this.getFullYear());
var m = this.getMonth() + 1;
var d = this.getDate();
m = (m < 10) ? '0' + m : String(m);
d = (d < 10) ? '0' + d : String(d);
return y + m + d;
};
}
@kaugesaar
kaugesaar / mcc-ad-disaproval-reasons.js
Last active March 21, 2016 00:19 — forked from russorat/mcc-ad-disaproval-reasons.js
This script will run through all your AdWords accounts and look for Ads that have been disapproved
/********************************************************************************
* This script will run through all your AdWords accounts and look for Ads that
* have been disapproved
*
* @author Russell Savage <russellsavage@gmail.com>
* @version 1.1
* - added functionally to run on specific accounts.
*
* FreeAdWordsScripts.com
*