Skip to content

Instantly share code, notes, and snippets.

Fibinse Xavier` fx86

View GitHub Profile
fx86 /
Last active Jul 27, 2018
Takes a Redash query ID and returns cached-data in a Pandas dataframe
# save your redash API key in a text file as below
api_key = open('api_key.config', 'r').readlines()[0]
def api_to_df(query_id, api_key=api_key):
Takes a Redash query ID and returns cached-results
in a Pandas dataframe
fx86 /
Last active Jun 24, 2018
Boilerplate code for scrapers - has query-caching, geocoding, refreshing proxies & enabling detailed logging
from glob import glob
from hashlib import md5
from fake_useragent import UserAgent as ua
from splinter import Browser
from splinter.exceptions import *
from selenium.common.exceptions import *
from random import randint
from time import sleep
import requests
import time
fx86 /
Created May 28, 2016
A much more effective algorithm for string similarity found on Stack Overflow
import wikipedia
def get_bigrams(string):
Takes a string and returns a list of bigrams
s = string.lower()
return [s[i:i+2] for i in xrange(len(s) - 1)]
def string_similarity(str1, str2):
You can’t perform that action at this time.