Skip to content

Instantly share code, notes, and snippets.

View dphiffer's full-sized avatar

Dan Phiffer dphiffer

View GitHub Profile
@dphiffer
dphiffer / gist:219019da33306f63f123
Created January 19, 2015 15:01
TA3M 2015-01-19
Happy MLK day! Join us today for an amazing TA3M:
Event: Current State of Censorship & Surveillance in Spain
Day: TODAY! Monday, January 19
Time: 6:30pm
Location: 199 Lafayette St, Suite 3b
RSVP:
https://www.eventbrite.com/e/current-state-of-censorship-surveillance-in-spain-tickets-15278627787
@dphiffer
dphiffer / test.md
Last active October 11, 2015 21:45
NY Times Beta code test (I did get an offer)

NYT section front

This is a small web application that displays a list of articles based on JSON & JSONP published to an Amazon S3 bucket. The implementation is in PHP, which is the language I'm most familiar with on the back-end.

@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 / lipsum_blender.rb
Last active October 11, 2015 21:43
LipsumBlender / code test for Position Development (I did not get an offer)
# LipsumBlender
# Dan Phiffer <[email protected]>
# August 2015
# LipsumBlender watches the current directory for .txt files, and accumulates
# the file contents into an internal corpus. This corpus is used to randomly
# generate a paragraph of 10 sentences, each containing 10 words. The frequency
# of the word selection is based on how commonly words appear within the
# aggregate input texts.
@dphiffer
dphiffer / 01-motivation.md
Last active September 18, 2015 22:36
Anthropocene Campus 2015 / anthropocene-curriculum.org

Letter of motivation

(3500 characters maximum including spaces)

My motivation for joining the Anthropocene Campus comes from a convergence of perspectives. I have experience as a technologist, as an artist, and as an educator (both in higher education and as a workshop leader). I’ve worked closely with journalists, and my projects are anchored by a sense of ethical responsibility—sometimes under the banner of “activism” or “advocacy” (what I regard as a baseline expression of civic participation). I would like to offer this mix of perspectives at the Campus and inflect it with ideas from other participants coming from the humanities, arts, and design.

Where I come from (I grew up in California), computer nerds have been emboldened by financial capital to assume a kind of extra-political control over our collective destinies. Rich technologists from America’s coasts are extending their relative dominance over the Technosphere to encompass aspects of the Biosphere, re-forming the “natural world” through m

@dphiffer
dphiffer / gh-pages-install.md
Last active October 11, 2015 20:39
Getting GitHub Pages running on a fresh install of OS X 10.10

This assumes you already have XCode installed, and have a project ready to go with a working Gemfile.

There’s more info at: https://help.github.com/articles/using-jekyll-with-pages/

  1. Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install Bundler: sudo gem install bundler
  3. Install libxml2 + libxslt: brew install libxml2 libxslt
  4. Install nokogiri: sudo env ARCHFLAGS="-arch x86_64" gem install nokogiri -- --use-system-libraries -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include
  5. Install everything else: bundler install
@dphiffer
dphiffer / esta_drop_down.txt
Last active October 31, 2015 17:16
U.S. Electronic System for Travel Authorization list of approved passports / https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1
ANDORRA (AND)
AUSTRALIA (AUS)
AUSTRIA (AUT)
BELGIUM (BEL)
BRUNEI (BRN)
CHILE (CHL)
CZECH REPUBLIC (CZE)
DENMARK (DNK)
ESTONIA (EST)
FINLAND (FIN)
@dphiffer
dphiffer / us_consulates_embassies.txt
Created October 31, 2015 17:16
U.S. State Department list of consulates and embassies / https://ceac.state.gov/genniv/
AFGHANISTAN, KABUL
ALBANIA, TIRANA
ALGERIA, ALGIERS
ANGOLA, LUANDA
ARGENTINA, BUENOS AIRES
ARMENIA, YEREVAN
AUSTRALIA, MELBOURNE
AUSTRALIA, PERTH
AUSTRALIA, SYDNEY
AUSTRIA, VIENNA
@dphiffer
dphiffer / us_consulates_embassies_countries.txt
Created October 31, 2015 17:27
U.S. State Department countries with consulates or embassies / https://ceac.state.gov/genniv/
AFGHANISTAN
ALBANIA
ALGERIA
ANGOLA
ARGENTINA
ARMENIA
AUSTRALIA
AUSTRIA
AZERBAIJAN
BAHAMAS
@dphiffer
dphiffer / rpi_setup.md
Last active February 19, 2016 00:24
Raspberry Pi setup