Skip to content

Instantly share code, notes, and snippets.

Shawn Graham shawngraham

View GitHub Profile
View trading-pots-on-a-network.netlogo
@shawngraham
shawngraham / network-message.nlogo
Created Mar 25, 2019
message-on-a-network for netlogo
View network-message.nlogo
@shawngraham
shawngraham / earth.py
Created Mar 5, 2019
grabbing cambridge airphotos
View earth.py
from bs4 import BeautifulSoup
import csv
import requests
file = open("output.txt", "w")
# f = csv.writer(open("output.csv", "w"))
# f.writerow(["domain", "fulllink"])
pages = []
View netlogo-commits.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View netlogo-commits
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="1996pt" height="58947pt"
viewBox="0.00 0.00 1995.62 58947.45" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 58943.4457)">
@shawngraham
shawngraham / textreuse.r
Last active Dec 7, 2018
walking through textreuse for andrew
View textreuse.r
# use ctrl+enter to run each line in turn
install.packages("textreuse")
# next line just displays the help file for the package in the help window in R studio
vignette("textreuse-introduction", package = "textreuse")
setwd("full-path-to-the-directory-you're-working-in")
# check what directory you're in
View imagetest.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
https://farm3.staticflickr.com/5310/5898076654_51085e157c_o.jpg
https://c1.staticflickr.com/1/67/197493648_628a7cb2ee_o.jpg
https://c7.staticflickr.com/8/7056/7143870979_83a291e780_o.jpg
https://farm5.staticflickr.com/5128/5301868579_f042b35323_o.jpg
https://c6.staticflickr.com/4/3930/15342460029_6f441b0439_o.jpg
https://c7.staticflickr.com/1/668/21529344631_4bdf3c253a_o.jpg
https://farm3.staticflickr.com/3892/14587227141_d36fa37264_o.jpg
https://c5.staticflickr.com/5/4024/4323769914_8f7b8a4a55_o.jpg
https://c5.staticflickr.com/4/3871/14594283694_43c91ce7f9_o.jpg
https://c4.staticflickr.com/8/7335/12405729553_4d56279bcc_o.jpg
View using-tabulizer.r
library("tabulizer")
# The file could be local, or it could be on the web.
# We're going to use
# Lane, K., Pomeroy, E. & Davila, M. (2018). Over Rock and Under Stone: Carved Rocks and Subterranean Burials at Kipia, Ancash, AD 1000 – 1532. Open Archaeology, 4(1), pp. 299-321. Retrieved 20 Jul. 2018, from doi:10.1515/opar-2018-0018
location <- 'https://www.degruyter.com/downloadpdf/j/opar.2018.4.issue-1/opar-2018-0018/opar-2018-0018.pdf'
# Next, let's grab the data in Table 1. This is on pg 6 of the pdf.
# The line below will open a window in the viewer on the right side
View barchart.css
.bar {
fill: steelblue;
}
.bar:hover {
fill: brown;
}
.axis {
font: 10px sans-serif;
View pas-api.ipynb
{
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import requests"
You can’t perform that action at this time.