Skip to content

Instantly share code, notes, and snippets.

View dphiffer's full-sized avatar

Dan Phiffer dphiffer

View GitHub Profile
@dphiffer
dphiffer / backup.sh
Created November 30, 2014 03:17
Backup your Mac files, and ignore all the weird hidden stufft
#!/bin/sh
# backup.sh
# Incrementally backup the enclosing folder
# Set this to where you want your files to get backed up to (include a trailing
# slash). This follows the same format as ssh, but you can also use a local
# file path here.
TARGET="dphiffer@192.168.1.8:/volume1/backups/dphiffer/"

Hello, Troy dads!

Please join us for a dad circle March 11 around 8:30pm. Thanks Andrew for hosting in February, next time we'll go back to Christian's yard in Lansingburgh, (snip). Let us know if you can't make March 11th and we can figure out another night. Also, if you're interested in hosting the April edition, let me know!

Nothing too formal, but hoping to get together and talk about our woes and glories at our varied stages of parenting and maintaining the human relationships that go along with it.

If you can't make it, don't want to make it, or need to be late (after bedtime), that's totally fine. No pressure whatsoever, but each dad has their own perspective and we all have different age kiddos, so more perspectives the better.

We don't have a strict format, but we do some sharing and updating that is done without imbibing, and then breaking into a more casual hangout. While we would appreciate just hanging with y'all in any format, we are also hopeful to actually make this more of a DIY therapeut

@dphiffer
dphiffer / README.md
Last active January 22, 2023 05:47
NYPL Labs Space/Time Engineer code test (I did not get an offer)

Dan Phiffer's Space/Time Exercise

This ended up taking a bit longer than I'd hoped. I started out by exploring the data using some JavaScript mapping libraries, but started to realize I was going to need something with a little more heft. I turned to Ruby, and decided the RGeo gem was the right thing for the job. It's been some time since I've used Ruby regularly, so there was some time spent reacquainting myself with some language stuff. And just getting up to speed with a library I had never used before.

At the core of the problem is this: how close is each address point to a street line? I looked up the math involved, and decided calculating things was going to be too much trouble. Then I discovered a very relevant message on the RGeo-users mailing list, and the rest of the solution was structuring the data properly.

I created a helper function point_line_dist(point, line) that returns the distance

@dphiffer
dphiffer / README.md
Last active October 31, 2022 19:41
Social Network contact data

Social Network contact data

I downloaded my account data archive from Twitter, Facebook, Instagram, LinkedIn, Mastodon, and Flickr. The files below should give you a sense for what kind of contact details get included in each export. Basically I'm wondering to what degree you can look at a list of contacts and use it to keep in touch outside of that service.

If you see a note that says "We can make this file beautiful and searchable ..." that is something that GitHub added because the CSV files are not technically valid.

@dphiffer
dphiffer / localities.csv
Last active May 5, 2022 21:56
Top 500 most popular locality names in the US (source SQL at the bottom)
209 Washington
185 Union
180 Jackson
138 Liberty
128 Franklin
126 Jefferson
122 Lincoln
93 Richland
93 Monroe
90 Harrison
@dphiffer
dphiffer / config.yml
Last active February 9, 2022 15:51
Revue export script
api_keys:
your_list: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@dphiffer
dphiffer / email.md
Created January 25, 2022 14:35
Re: We’re Hiring at D— - The Next Frontier in Computing

Hi J—,

Thanks for taking an interest in me. I have a young daughter who's turning 3 in a couple weeks. Your project threatens her future on a warming planet. This is not abstract or theoretical to me, receiving this email is equivalent to getting recruited by a fossil fuel company.

If I thought there were some way I could talk you out of what you're doing I would try, but I have seen the discussions online and I know it's impossible to reason people out of a gold rush mentality. Please take me off your mailing list and please really take a minute to think about the impact of your work.

Dan

On Jan 24, 2022, at 1:07 PM, J— <[snip]> wrote:

@dphiffer
dphiffer / txt2pdf.js
Created July 28, 2021 18:21
Basic Text → PDF converter
const puppeteer = require('puppeteer');
const fs = require('fs');
if (process.argv.length < 3) {
console.log('Usage: node txt2pdf.js [file]');
process.exit(1);
}
const input = process.argv[2];
const output = `${input}.pdf`;
@dphiffer
dphiffer / vaccine-check.sh
Last active July 25, 2021 05:32
A script that monitors vaccine appointment availability at New York State-run providers.
#!/bin/bash
# see also: https://kvz.io/bash-best-practices.html
set -o errexit
set -o pipefail
set -o nounset
# A script to monitor updates to this web page:
# https://am-i-eligible.covid19vaccine.health.ny.gov/
#
@dphiffer
dphiffer / reinstall.md
Last active May 14, 2021 01:40
Notes for reinstalling macOS

I just did a clean install of macOS. Here's what got reinstalled on day one:

  • Atom
  • Audacity
  • Authy
  • Canon EOS Utility
  • Canon printer/scanner drivers
  • Clipy
  • Docker Desktop
  • Final Cut Pro