Skip to content

Instantly share code, notes, and snippets.

View paldhous's full-sized avatar

Peter Aldhous paldhous

View GitHub Profile
@paldhous
paldhous / pdf_search.sh
Created January 4, 2024 16:45
Bash script to search a folder for digital PDFs containing keyword/phrase
for file in *.pdf; do
pdftotext "$file" - | grep -q "keyword" && echo "$file"
done
# load required packages
library(rtweet)
library(tidyverse)
# get tweets (you will need a Twitter API token to run this code)
edge <- get_timeline("edge", n = 3200)
# function for frequency table
count_pct <- function(df) {
return(
@paldhous
paldhous / names.R
Last active March 5, 2019 00:47
R code to generate a randomly selected combination of first/last names from 1990 data
# load required packages
library(dplyr)
library(babynames)
library(readr)
# first names from 1990 Social Security Adminstration baby names data
malenames <- babynames %>%
filter(year == 1990 & sex == "M")
malenames <- malenames %>%
@paldhous
paldhous / inuag_weekend_planes.csv
Created January 26, 2017 18:02
Tail numbers for aircraft mapped in the Jan 25, 2017 BuzzFeed News post "These Maps Show The How The Feds And Cops Watched Trump’s Inauguration And Protests From The Air" https://www.buzzfeed.com/peteraldhous/spy-planes-inauguration-weekend
reg name type
N137HP CALIFORNIA HIGHWAY PATROL State
N212FX COUNTY OF FAIRFAX Local
N220PD CITY OF OAKLAND Local
N269FL US DEPARTMENT OF HOMELAND SECURITY Federal
N314HP CALIFORNIA HIGHWAY PATROL State
N520PG PRINCE GEORGES COUNTY Local
N613TC T A F Y CONSULTING Federal
N661PD LAPD AIR SUPPORT DIVISION Local
N662PD LAPD AIR SUPPORT DIVISION Local