Skip to content

Instantly share code, notes, and snippets.

<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" result="goo" />
<feBlend in="SourceGraphic" in2="goo" />
</filter>
[{
"key": "Route1",
"values": [{"lon": 5392564.725492327, "lat": 2974660.537320351, "el": 52.6, "d": 0}, {"lon": 5392574.3462526705, "lat": 2974720.383022819, "el": 52.0, "d": 0.03766377314093973}, {"lon": 5392580.489136536, "lat": 2974745.190765788, "el": 51.8, "d": 0.053544112668845484}, {"lon": 5392600.588315832, "lat": 2974804.1075405283, "el": 52.2, "d": 0.09222489852128239}, {"lon": 5392607.8968365695, "lat": 2974866.1858293726, "el": 52.8, "d": 0.13106488987249082}, {"lon": 5392603.67043018, "lat": 2974929.0978775197, "el": 53.6, "d": 0.17024466219025763}, {"lon": 5392603.092126638, "lat": 2974934.092772495, "el": 53.8, "d": 0.1733690728586409}, {"lon": 5392598.762995767, "lat": 2974980.288888961, "el": 54.8, "d": 0.2021997205108774}, {"lon": 5392592.871768514, "lat": 2975042.315971373, "el": 55.0, "d": 0.24091493872810624}, {"lon": 5392584.222960228, "lat": 2975103.9196614283, "el": 54.0, "d": 0.2795690300408873}, {"lon": 5392582.099367059, "lat": 2975112.064188394, "el": 53.6, "d": 0.28479899
a = 'CURAÌàAO'
def normalize_str(x):
if type(x) != unicode:
encoding = "utf-8" # or iso-8859-15, or cp1252, or whatever encoding you use
byte_string = bytes(x) # or simply "café" before python 3.
unicode_string = byte_string.decode(encoding)
else:
unicode_string = x
return unicodedata.normalize('NFD', unicode_string).encode('ascii','ignore')
library(stringr)
preprocess_products <- function(product_data) {
product_names <- as.character(product_data$NombreProducto)
weight <- unlist(lapply(product_names, extract_weight))
pieces <- unlist(lapply(product_names, extract_pieces))
brand <- unlist(lapply(product_names, extract_brand))
has_choco <- unlist(lapply(product_names, grepl, pattern="Choco"))
has_vanilla <- unlist(lapply(product_names, grepl, pattern="Va(i)?nilla"))
WITH A AS (
SELECT
"route_id",
"client_id",
"sales_channel_id",
"sales_depot_id"
FROM "test_prepared"
),
B AS (
SELECT
@dvreed77
dvreed77 / index.html
Created August 1, 2016 18:59
Copy an image to clipboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p>
<textarea class="js-copytextarea">Hello I'm some text</textarea>
from selenium import webdriver
# driver = webdriver.Firefox()
driver = webdriver.PhantomJS()
driver.set_window_size(1120, 550)
driver.get("https://duckduckgo.com/")
driver.find_element_by_id('search_form_input_homepage').send_keys("google slavery")
driver.find_element_by_id("search_button_homepage").click()
out = driver.find_elements_by_xpath("//div[@id='links']/div")
# out
@dvreed77
dvreed77 / gist:b4bd63a15acac2dd4a19
Created November 20, 2015 21:39 — forked from ChadFulton/gist:7535278
Statsmodels ARIMA Example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dvreed77
dvreed77 / es.sh
Created October 16, 2015 20:52 — forked from rajraj/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@dvreed77
dvreed77 / index.html
Last active December 26, 2015 11:49
Register mouse events on screen
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.overlay {
fill-opacity: 0.1;
}
circle {
fill: black;
}
</style>