Skip to content

Instantly share code, notes, and snippets.

View mtdukes's full-sized avatar

Tyler Dukes mtdukes

View GitHub Profile
@mtdukes
mtdukes / nc_census_places_tab.tsv
Created July 22, 2022 17:05
A list of North Carolina "places" (including towns, villages, cities and CDPs) according to the U.S. Census Bureau, in tab-delimited format.
census_label municipality census_category
Aberdeen town, North Carolina ABERDEEN town
Advance CDP, North Carolina ADVANCE CDP
Ahoskie town, North Carolina AHOSKIE town
Alamance village, North Carolina ALAMANCE village
Albemarle city, North Carolina ALBEMARLE city
Alexis CDP, North Carolina ALEXIS CDP
Alliance town, North Carolina ALLIANCE town
Altamahaw CDP, North Carolina ALTAMAHAW CDP
Anderson Creek CDP, North Carolina ANDERSON CREEK CDP
@mtdukes
mtdukes / nc_municipalities_tab.tsv
Created July 22, 2022 16:29
A list of NC municipalities and corresponding counties, in tab-delimited format. Sourced from: https://www.sog.unc.edu/resources/microsites/knapp-library/cities-north-carolina
municipality municipality_upper county
Aberdeen ABERDEEN MOORE
Ahoskie AHOSKIE HERTFORD
Alamance ALAMANCE ALAMANCE
Albemarle ALBEMARLE STANLY
Albertson ALBERTSON DUPLIN
Alliance ALLIANCE PAMLICO
Andrews ANDREWS CHEROKEE
Angier ANGIER HARNETT;WAKE
Ansonville ANSONVILLE ANSON
#!/bin/sh
#simple shell script to copy the project template folder
#and add it to the directory with a new name
# zzPROJECT_TEMPLATE structure:
# data/
# L data_diary.txt
# L originals/
# documents/
# images/
@mtdukes
mtdukes / block-assignments.csv
Last active February 23, 2022 19:54
Interim Congressional Plan block assignment files released as part of the Feb. 23, 2022 order on remedial plans: https://www.documentcloud.org/documents/21273026-order-on-remedial-plans-feb-23-2022
We can't make this file beautiful and searchable because it's too large.
GEOID20,District
371510310023000,9
371510310023001,9
371510310023002,9
371510310023003,9
371510310023004,9
371510310023005,9
371510312001000,9
371510312001001,9
371510312001002,9
@mtdukes
mtdukes / us_fips_tab.tsv
Created August 10, 2021 21:08
US fips codes, tab-delimited
fips name state
01001 Autauga AL
01003 Baldwin AL
01005 Barbour AL
01007 Bibb AL
01009 Blount AL
01011 Bullock AL
01013 Butler AL
01015 Calhoun AL
01017 Chambers AL
@mtdukes
mtdukes / nc_fips_tab.tsv
Last active July 31, 2021 20:08
NC fips codes, tab-delimited
county county_cap fips
Alamance ALAMANCE 37001
Alexander ALEXANDER 37003
Alleghany ALLEGHANY 37005
Anson ANSON 37007
Ashe ASHE 37009
Avery AVERY 37011
Beaufort BEAUFORT 37013
Bertie BERTIE 37015
Bladen BLADEN 37017
@mtdukes
mtdukes / import_cdc_covid.R
Created July 28, 2021 02:27
Simple script to import data on COVID-19 from the CDC website.
'''
A simple script to grab COVID data from the CDC
hastily typed by @mtdukes
Follow the Twitter thread for more detail:
https://twitter.com/mtdukes/status/1420191934979657731
'''
#install your packages, if you haven't already
@mtdukes
mtdukes / nc_county_election_codes.txt
Created May 12, 2021 20:43
NC county election board codes
county county_id
ALAMANCE 1
ALEXANDER 2
ALLEGHANY 3
ANSON 4
ASHE 5
AVERY 6
BEAUFORT 7
BERTIE 8
BLADEN 9
@mtdukes
mtdukes / nc_court_codes.txt
Last active October 11, 2022 14:25
NC county court codes
county_name county_number
ALAMANCE 000
ALEXANDER 010
ALLEGHANY 020
ANSON 030
ASHE 040
AVERY 050
BEAUFORT 060
BERTIE 070
BLADEN 080
@mtdukes
mtdukes / gist:896bd64474ec4fe48b2395447982934f
Created November 4, 2020 19:30
Common command-line junk
## Detect encoding of a file
file -I (input file)