Skip to content

Instantly share code, notes, and snippets.

View rdempsey's full-sized avatar

Robert Dempsey rdempsey

View GitHub Profile
import unittest
def foo(x, y, z):
return (x != y and x != z or x and z)
def get_test_args():
x = y = z = [True, False]
from itertools import product, repeat
input_args = list(product(x, y, z))
expected_args = [
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# building the classifier
from sklearn.ensemble import RandomForestClassifier
# I find it easiest to just define all the features you'll be using in a list. In
# our case it's just the fuzzy scores that we generated using fuzzywuzzy.
features = [
'name_ratio',
'name_token_sort_ratio',
'name_partial_ratio',
'street_ratio',
import sys
import requests
from arango import create
from bs4 import BeautifulSoup
HEADERS = {
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)",
@huangzhichong
huangzhichong / selenium-webdriver-cheatsheet.md
Created August 7, 2012 12:38
Selenium Webdriver CheatSheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@igor-alexandrov
igor-alexandrov / settings.rb
Created December 11, 2011 18:51
Multiple configuration files in SettingsLogic
class Settings < Settingslogic
source "#{Rails.root}/config/application.yml"
if Rails.env == 'development'
namespace 'development-' + Socket.gethostname.gsub(/\W/, '-').gsub(/[-]{2,}/, '-')
else
namespace Rails.env
end
# load local settings