Skip to content

Instantly share code, notes, and snippets.

@AABoyles
AABoyles / creds.R
Created April 13, 2015 18:23
Credentials to connect to postgresql
library("RPostgreSQL")
con <- dbConnect(dbDriver("PostgreSQL"),
host="your database's host",
port="5432",
user="your database's username",
password="your database's password",
dbname="your database's name")
@AABoyles
AABoyles / bootstrap.sh
Last active May 9, 2018 14:34
Bootstrap a Ubuntu Machine
#!/usr/bin/env bash
## Deprecated. See instead: https://github.com/AABoyles/dotfiles/blob/master/bootstrap.sh
## Make sure we get the latest stable release of R.
echo 'deb https://cran.rstudio.com/bin/linux/ubuntu xenial/' >> /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt-get update
@AABoyles
AABoyles / Resume.md
Created October 15, 2015 17:04
My Resume. In Markdown.

Anthony A. Boyles

Contact

Anthony@Boyles.cc (617) 935-5515 AABoyles.com

Work Experience

@AABoyles
AABoyles / ocr.sh
Created October 23, 2015 19:49
Run this, select a screen region with some un-copyable text, and paste it like normal text.
#!/bin/bash
# Dependencies: tesseract-ocr imagemagick scrot xsel
SCR_IMG=`mktemp`
trap "rm $SCR_IMG*" EXIT
scrot -s $SCR_IMG.png
mogrify -modulate 100,0 -resize 400% $SCR_IMG.png #should increase detection rate
tesseract $SCR_IMG.png $SCR_IMG &> /dev/null
cat $SCR_IMG.txt | xsel -bi
import random
exclusive = 0
def bad(thing_name, chance):
x = random.random()
if x < chance:
print (thing_name)
if thing_name in ("The person is in prison", "The person is on probation", "The person is in a nursing home", "The person is unemployed"):
exclusive = 1
@AABoyles
AABoyles / ocr
Last active March 8, 2016 13:52
scripts
#!/usr/bin/env bash
# Dependencies: tesseract-ocr imagemagick scrot xsel
SCR_IMG=`mktemp`
trap "rm $SCR_IMG*" EXIT
scrot -s $SCR_IMG.png
mogrify -modulate 100,0 -resize 400% $SCR_IMG.png #should increase detection rate
tesseract $SCR_IMG.png $SCR_IMG &> /dev/null
cat $SCR_IMG.txt | xsel -bi

Keybase proof

I hereby claim:

  • I am aaboyles on github.
  • I am aaboyles (https://keybase.io/aaboyles) on keybase.
  • I have a public key ASDAK6eNV4P2ZmcFFy74MMIKcMwSsVfyGxfL7iCekYa2IQo

To claim this, I am signing this object:

@AABoyles
AABoyles / SCF.R
Created January 26, 2017 16:24
SupremeCourtFill
library(readr)
library(dplyr)
nominees <- read_csv("https://docs.google.com/spreadsheets/d/1xsjTL6DbfEyR57MoZD3lIG8tTU-yblRA9ehQuaoj9Wg/pub?gid=0&single=true&output=csv")
confirmations <- nominees %>%
filter(Result == "confirmed")
longConfirmations <- confirmations %>%
filter(Days > 62)
@AABoyles
AABoyles / run.sh
Last active May 9, 2018 20:01
Set up a Mac to build MicrobeTrace
#!/bin/bash
# Step 1: Download Node
curl https://nodejs.org/dist/v10.0.0/node-v10.0.0-darwin-x64.tar.gz | tar -xz
# Step 2: Install Node
export PATH=/Users/`whoami`/node-v10.0.0-darwin-x64/bin:$PATH
# Step 3: Download MicrobeTrace
git clone https://github.com/CDCgov/MicrobeTRACE.git && cd MicrobeTrace
@AABoyles
AABoyles / index.html
Last active February 21, 2019 14:45
PVvOOx
<html>
<head>
<style>
html, body {
height: 100%;
}
</style>
</head>
<body>
<script src="https://d3js.org/d3.v5.min.js"></script>