Skip to content

Instantly share code, notes, and snippets.

Shawn Graham shawngraham

Block or report user

Report or block shawngraham

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View golems-in-the-city-with-colds.nlogo
shawngraham / network-message.nlogo
Created Mar 25, 2019
message-on-a-network for netlogo
View network-message.nlogo
View jesuits-groove.rb
#require 'csv'
#data = CSV.parse("/Users/shawngraham/jesuit/jes2.csv"), {:headers => true, :header_converters => :symbol})
#trying to get a bit more performative with the sonic-pi. Two columns of topics.
use_bpm 50
live_loop :amen_break do
sample :loop_amen, beat_stretch: 2 #,cutoff: 70
sleep 2
View trading-pots-on-a-network.netlogo
View text-to-csv.bat
@echo off
setlocal EnableDelayedExpansion
if exist result.csv del result.csv
for %%f in (*.txt) do (
set i=0
for /F "delims=" %%l in (%%f) do (
set /A i+=1
set line!i!=%%l
echo %%f, !line1!, !line2!, >> result.csv
shawngraham /
Created Mar 5, 2019
grabbing cambridge airphotos
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"
<!-- 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="" xmlns:xlink="">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 58943.4457)">
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
# next line just displays the help file for the package in the help window in R studio
vignette("textreuse-introduction", package = "textreuse")
# check what directory you're in
shawngraham / ldavis-for-tweets.r
Created Dec 17, 2015
R script for lda topic model of my tweets, then visualized with ldaVIS package.
View ldavis-for-tweets.r
setwd("/Users/shawngraham/Desktop/data mining and tools/tweetsdec17")
# install.packages("rio")
# install.packages("tm")
options(java.parameters = "-Xmx5120m")
##importing opencontext site diaries
importdocs <- lapply("tweets.csv", readLines) ## change this to the version that doesn't have the date columns, or figure out how to tell r to just grab the text column
## or rather, maybe just the year column, because that becomes a word, in which case might see some interesting patterns
You can’t perform that action at this time.