Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile
<html>
<head>
<title>Responsive Table</title>
<meta charset="UTF-8">
<meta name="description" content="How to create a responsive table">
<meta name="keywords" content="HTML,CSS">
<meta name="author" content="Martine Dowden">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Calendar of Police Killings</title>
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
<style>
body { font-family: 'Fira Sans'; text-align: center; }
@jalbertbowden
jalbertbowden / merge-geojsons.py
Created March 23, 2021 20:50 — forked from migurski/merge-geojsons.py
Merge multiple GeoJSON files into one
from json import load, JSONEncoder
from optparse import OptionParser
from re import compile
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$')
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$')
parser = OptionParser(usage="""%prog [options]
Group multiple GeoJSON files into one output file.
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 10 columns, instead of 7. in line 9.
Report Date,Date VDH Notified,Status,Locality,FIPS,Facility,Facility Type,Cases,Deaths,Active
12/18/2020,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult Daycare Program,27,0,0
12/25/2020,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult Daycare Program,27,0,0
01/01/2021,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult Daycare Program,27,0,0
01/08/2021,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult Daycare Program,27,0,0
01/15/2021,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult Daycare Program,27,0,0
01/22/2021,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult Daycare Program,27,0,0
01/29/2021,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult Daycare Program,27,0,0
02/05/2021,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult Daycare Program,27,0,0
02/12/2021,10/30/2020,Outbreak Closed,Henrico,51087,Family Life Services LLC,Adult
@jalbertbowden
jalbertbowden / bs-scrape-docx.py
Created February 12, 2021 21:59
Scrape document.xml with Python's BeautifulSoup
from bs4 import BeautifulSoup
docx_form = 'form_example/word/document.xml'
infile = open(docx_form, 'r')
contents = infile.read()
soup = BeautifulSoup(contents, 'xml')
@jalbertbowden
jalbertbowden / scrape-docx.py
Created February 12, 2021 21:17
Scrape .docx with python-docx library.
from docx import Document
document = Document('form_example.docx')
document.save('form_example.docx')
for table in document.tables:
for row in table.rows:
for cell in row.cells:
for para in cell.paragraphs:
print(para.text)
@jalbertbowden
jalbertbowden / covid-19-virginia-ltcf-data.py
Last active February 9, 2021 01:57
COVID-19 Virginia LTCF Dataops - Python script for cleaning up Virginia LTCF COVID-19 data.
from csv import DictReader, DictWriter
import csv
file_name_base = 'vdh-covid-19-public-use-dataset-outbreaks-in-selected-exposure-settings-'
file_date = '2021-01-29'
file_row_report_date = '01/29/2021'
file_format = '.csv'
file_dataset = '-ltcf'
file_step_1 = '-fixed'
file_step_2 = '-updated'
@jalbertbowden
jalbertbowden / snippets-importing-libraries.ipynb
Created December 5, 2018 22:48
Snippets: Importing libraries
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.