Skip to content

Instantly share code, notes, and snippets.

source target weight
sam tully 3
sam pat 8
sam kim 2
sam pris 1
roy pris 5
roy sam 1
tully sam 1
tully pris 5
tully kim 3
#Script for scraping Chronicling America
import requests
import re
import csv
from bs4 import BeautifulSoup, SoupStrainer
import os
from time import sleep
from datetime import date, datetime, timedelta
#search_terms is a string of words separated by spaces.
# Requires ImageMagick
# Converting the source from JPEG to PNG - if necessary
convert my_src_image.jpg my_src_image.png
# Option A
# - Requires a temporary intermediate file
# - Drill more than 10 might result in poor results
@vlandham
vlandham / README.md
Last active September 30, 2019 22:59 — forked from awoodruff/README.md
Head Projections Remix

A quick hack on the beautifully executed projection example from Andy Woodruff. I just wanted to see them all on one screen.

Click the Open in new window button to see them all.

Novel code Inspired once again by Jason Davies.

Andy's original text:

We've all seen the projected head from Elements of map projection with applications to map and chart construction, but the authors in 1921 did not have D3 to help them show a full range of weird distorted faces. This is based on the Map Projection Transitions example by Jason Davies.

@vlandham
vlandham / amplitude_time_density_example.R
Created February 24, 2017 19:30 — forked from memoryfull/amplitude_time_density_example.R
An example of seewave::acoustat amplitude density calculation
# Install dependencies
#install.packages(c("fftw","tuneR","rgl","rpanel", "seewave"), repos="http://cran.at.r-project.org/")
# for Fast Fourier transform (fftw) to work, install
# the fftw lib (e.g. brew install fftw)
# Load libraries
library(data.table)
library(tuneR)
library(seewave)
@vlandham
vlandham / Makefile
Created December 21, 2013 21:57 — forked from mjhoy/Makefile
all: hill-relief.jpg costarica_min_topo.json
# -------------
# Relief raster
# -------------
#
# Notice the `zip` file requirements here have no download.
# You will need to search for them online. They are from the
# SRTM project: http://www2.jpl.nasa.gov/srtm/
# (which appears to have multiple versions of files).

Command Line Basics

Rando Stuff

Find the full path of the folder you're in

pwd

Using d3.geo.tile to display raster image tiles underneath some TopoJSON vectors, and d3.behavior.zoom for pan & zoom.

@vlandham
vlandham / math_demo.js
Created February 28, 2013 21:02 — forked from tmcw/README.md
// Turning an angle into a point on a unit
// circle and then back again
// convert from degrees to radians
D2R = Math.PI / 180;
// convert from radians to degrees
R2D = 180 / Math.PI;
// our angle
angle = 30;
@vlandham
vlandham / index.html
Last active December 14, 2015 07:29 — forked from ZJONSSON/index.html
<!DOCTYPE html>
<html>
<head>
<title>Testing d3.js in Leaflet.js</title>
<link rel="stylesheet" href="leaflet.css"></link>
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<style type="text/css">
svg , g