Campaign | type | summary |
---|---|---|
CAMPAIGN |
PJ |
SUMMARY |
Culture: =this.culture
Calling: =this.calling
Cultural Blessing: =this.CulturalBlessing
Shadow Path: =this.ShadowPath
# coding: utf-8 | |
import pandas as pd | |
import numpy as np | |
import yaml | |
# ## Input data file | |
venues_filename = 'venues.csv' |
## Stolen from http://www.obeythetestinggoat.com/how-to-get-selenium-to-wait-for-page-load-after-a-click.html | |
class wait_for_page_load(object): | |
def __init__(self, browser): | |
self.browser = browser | |
def __enter__(self): | |
self.old_page = self.browser.find_element_by_tag_name('html') |
# coding: utf-8 | |
import requests | |
import json | |
import os | |
base_url = 'https://www.humblebundle.com/api/v1/order/{download_key}' | |
# Get this one from the bundle page url | |
download_key = '' |
find . -name "*.shp" | sort > shps.txt | |
# In this case: the name of the country is the first word of the shape name and after there is a number | |
sed -ie 's/^\.\/\([a-z_-]*\)_\([0-9]\)/\1,.\/\1_\2/' shps.txt | |
cat shps.txt | header -a cname,shape > shapes.txt | |
csvcut -c 1 shapes.txt | uniq | sort > countries.txt | |
# This works only in Mac | |
pbcopy < countries.txt | |
# Match the countries with the isocodes | |
csvjoin -c cname countries.txt shapes.txt | csvcut -c 1,3 > isoshapes.csv | |
# ZSH to read a file |
set number | |
set numberwidth=5 | |
set nocompatible " be iMproved, required | |
set backspace=indent,eol,start " Backspace for dummies | |
set linespace=0 " No extra spaces between rows | |
set showmatch " Show matching brackets/parenthesis | |
set incsearch " Find as you type search | |
set hlsearch " Highlight search terms | |
set winminheight=0 " Windows can be 0 line high | |
set ignorecase " Case insensitive search |
def __poly_decode_trans(value, index): | |
"""Transforms a GMaps Encoded polyline chunk back into numbers | |
Args: | |
value: chunk of the GMaps polyline | |
index: position in the chunk | |
Returns: | |
chunk as a number | |
""" |
CREATE OR REPLACE FUNCTION slugify("value" TEXT) | |
RETURNS TEXT AS $$ | |
WITH lowercased AS ( | |
SELECT lower(value) AS value | |
), | |
translated AS ( | |
SELECT translate( value, | |
'áàâãäåāăąèééêëēĕėęěìíîïìĩīĭḩóôõöōŏőùúûüũūŭůäàáâãåæçćĉčöòóôõøüùúûßéèêëýñîìíïş', | |
'aaaaaaaaaeeeeeeeeeeiiiiiiiihooooooouuuuuuuuaaaaaaeccccoooooouuuuseeeeyniiiis' | |
) AS value |
import os | |
from osgeo import ogr, gdal | |
PG_CONN = { | |
'user': os.getenv('DATA_USER'), | |
'password': os.getenv('DATA_PWD'), | |
'port': os.getenv('DATA_PORT'), | |
'host': os.getenv('DATA_HOST'), | |
} |
Campaign | type | summary |
---|---|---|
CAMPAIGN |
PJ |
SUMMARY |
Culture: =this.culture
Calling: =this.calling
Cultural Blessing: =this.CulturalBlessing
Shadow Path: =this.ShadowPath
tags |
---|
obsidian, html, export, favourite |