Skip to content

Instantly share code, notes, and snippets.

View pandringa's full-sized avatar

Peter Andringa pandringa

View GitHub Profile
@pandringa
pandringa / regexes.md
Last active August 29, 2015 14:05
Useful Regexes

Search

/^(?=.*\b<word1>)(?=.*\<word2>)/ - Good for typeahead search with MongoDB, because it matches words in any order. To use, split a query string by spaces, then insert each word into the regex surrounded by parenthesies with forward lookahead ((?=.* )). Here, I've included the \b which matches the start of a word, to ensure users' results aren't cluttered by random letters in the middle of words. (http://rubular.com/r/hnOalIdRYA)

URLs

https://gist.github.com/gruber/8891611 - Best one I've seen for matching web URLS

Emails

@pandringa
pandringa / trump-2018-sotu.txt
Last active January 31, 2018 17:00
Full Text of Trump's 2018 State of the Union
Mr. Speaker, Mr. Vice President, Members of Congress, the First Lady of the United States, and my fellow Americans:
Less than 1 year has passed since I first stood at this podium, in this majestic chamber, to speak on behalf of the American People -- and to address their concerns, their hopes, and their dreams. That night, our new Administration had already taken swift action. A new tide of optimism was already sweeping across our land.
Each day since, we have gone forward with a clear vision and a righteous mission -- to make America great again for all Americans.
Over the last year, we have made incredible progress and achieved extraordinary success. We have faced challenges we expected, and others we could never have imagined. We have shared in the heights of victory and the pains of hardship. We endured floods and fires and storms. But through it all, we have seen the beauty of America's soul, and the steel in America's spine.
Each test has forged new American heroes to remind us who we are, and show us w
@pandringa
pandringa / clemency.csv
Last active June 8, 2018 15:42
Justice Dept Clemency Statistics (scraped from https://www.justice.gov/pardon/clemency-statistics)
president yearString year pardons commutations
William McKinley 1900 1900 129 73
William McKinley 1901 1901 162 50
Theodore Roosevelt 1902 1902 92 36
Theodore Roosevelt 1903 1903 70 57
Theodore Roosevelt 1904 1904 87 62
Theodore Roosevelt 1905 1905 109 52
Theodore Roosevelt 1906 1906 96 52
Theodore Roosevelt 1907 1907 71 30
Theodore Roosevelt 1908 1908 53 22
@pandringa
pandringa / Makefile
Last active February 1, 2019 16:43
A simple Makefile to automatically Comp 411 Lab tests
# COMP 411 Lab Makefile
# See https://gist.github.com/pandringa/0430db89b1a215bc02e7ace910ed07d8 for usage information
# Author: Peter Andringa <peter.andringa@unc.edu>
# Spring 2019
num = $(shell find $? | grep -oP '\d')
ex%: ex%.c
gcc $? -o ex$(num);

Keybase proof

I hereby claim:

  • I am pandringa on github.
  • I am peterandringa (https://keybase.io/peterandringa) on keybase.
  • I have a public key ASBdg_F7mc5w_gNZeVeh3IdFZzNQ71EIRQq9Xt_RFH5PwQo

To claim this, I am signing this object: