This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.iCal = function($el) { | |
var ical = [""]; | |
ical.push("BEGIN:VCALENDAR"); | |
ical.push("VERSION:2.0"); | |
ical.push("PRODID:HTML"); | |
if ( $el.attr("itemtype") === "http://microformats.org/profile/hcalendar#vevent" ) { | |
ical.push("BEGIN:VEVENT"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
["es2015", { "loose":true }] | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import re | |
import argparse | |
def cleanFilename(name): | |
# rremove spaces from " - ", to "-" | |
name = re.sub(r'\s+\-\s+', '-', name) | |
name = re.sub(r'\s+', '-', name) | |
return name.lower() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.bounce { | |
animation: bounce 2s 3; | |
} | |
@keyframes bounce { | |
0% { transform: translateY(0); } | |
20% { transform: translateY(0); } | |
30% { transform: translateY(-10px); } | |
40% { transform: translateY(-5px); } | |
50% { transform: translateY(5px); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys | |
import glob | |
import os | |
import shutil | |
from tempfile import TemporaryDirectory | |
from urllib.request import urlopen, URLError, HTTPError | |
import zipfile | |
import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro sentence_case(text) %} | |
{{ text[0]|upper}}{{text[1:] }} | |
{% endmacro %} | |
<p>{{ sentence_case(comment) }}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# e.g. pluralise("country", "y", "ies", "2") = "countries" | |
def pluralise(str, str_off, str_on, count): | |
strip_count = -1*len(str_off) if len(str_off) > 0 else len(str) | |
if count > 1: | |
return str[:strip_count]+str_on | |
else: | |
return str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def patch_remote_dataset(name, key): | |
url="https://github.com/digital-land/boundary-collection/raw/master/index/local-authority-boundary.csv" | |
try: | |
# create tmp location | |
tmp_dir = "data/tmp" | |
if not os.path.exists(tmp_dir): | |
os.makedirs(tmp_dir) | |
tmp_path = csv_path(tmp_dir, "local-authority-boundary") | |
# fetch file | |
response = requests.get(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appdirs==1.4.4 | |
asyncio==3.4.3 | |
Pillow==7.1.2 | |
pyee==7.0.1 | |
pyppeteer==0.2.2 | |
tqdm==4.46.0 | |
urllib3==1.25.9 | |
websockets==8.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import json | |
from urllib.request import Request, urlopen | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
def parse_page_for_twitter_links(url): |