Skip to content

Instantly share code, notes, and snippets.

@csessig86
csessig86 / gist:2046849
Created March 15, 2012 20:52
Timeline.py part 10
# We'll replace commas with dashes so we don't screw up the CSV. You can change the dash to whatever character you want
date3 = date2.replace(",", " -")
link3 = link2.replace(",", " -")
headline3 = headline2.replace(",", " -")
description3 = description2.replace(",", " -")
image3 = image2.replace(",", " -")
@csessig86
csessig86 / gist:2046875
Created March 15, 2012 20:56
Timeline.py 11
# Extract that information in strings
date2 = str(date)
link2 = str(link)
headline2 = str(headline)
image2 = str(image)
# These are pulled from outside the loop
description2 = str(description)
@csessig86
csessig86 / gist:2046904
Created March 15, 2012 21:00
Timeline.py part 12
# Write the information to the file. The HTML code is based on coding recognized by TimelineSetter
f.write(date8 + "," + description7 + "," + link3 + "," + '<h2 class="timeline-img-hed">' + headline3 + '</h2>' + image5 + "\n")
@csessig86
csessig86 / gist:2046936
Created March 15, 2012 21:05
Timeline.py part 13
#You're done! Close file.
f.close()
@csessig86
csessig86 / crime_scraper.py
Created June 29, 2012 21:00
This Python scraper pulls information off a PDF after its been converted to HTML. The PDF is a weekly arrest log provided by the Waterloo Police Department. The information is then put into a CSV file.
# We will be using the Python library Beautiful Soup
# To scrape the information
import urllib2
from bs4 import BeautifulSoup
import re
# Note: This arrest log is available at:
# http://chrisessig.com/arrestlog.PDF
# It was taken from the Waterloo Police Department's website:
# http://www.waterloopolice.com/images/arrestlog.PDF
@csessig86
csessig86 / geojson.js
Created July 8, 2012 08:18 — forked from mourner/geojson.js
Leaflet GeoJSON API proposal
var geojson = L.geoJson(data, {
// style for all vector layers (color, opacity, etc.) (optional)
getStyle: function (feature) {
return feature.properties && feature.properties.style;
},
// function for creating layers for GeoJSON point features (optional)
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
@csessig86
csessig86 / gist:3183391
Created July 26, 2012 17:37
Vmix > Fusion Table tutorial 1
<param name='movie' value='" + u + "'/>
@csessig86
csessig86 / gist:3183397
Created July 26, 2012 17:38
Vmix > Fusion Table tutorial 2
<param name='movie' value='http://cdn-akm.vmixcore.com/player/2.0/player.swf?player_id=48df95747124fbbad1aea98cee6e46e4'/>
@csessig86
csessig86 / gist:3183406
Created July 26, 2012 17:39
Vmix > Fusion Table tutorial 3
<OBJECT id='V0CuCNmu2y-DUmYkbBQt2AckDDshqeGrQd' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='350' height='260'>
<param name='FlashVars' value='debug=&services_url=http://cdn-akm.vmixcore.com/core-flash/UnifiedVideoPlayer/services.xml&token=V0CuCNmu2y-DUmYkbBQt2AckDDshqeGrQd&player_id=48df95747124fbbad1aea98cee6e46e4&ref=location.href'/>
<param name='movie' value='http://cdn-akm.vmixcore.com/player/2.0/player.swf?player_id=48df95747124fbbad1aea98cee6e46e4'/>
<param name='wmode' value='opaque'/>
<param name='allowFullScreen' value='true'/>
<param name='AllowScriptAccess' value='always'/>
<embed src='http://cdn-akm.vmixcore.com/player/2.0/player.swf?player_id=48df95747124fbbad1aea98cee6e46e4' wmode='opaque' allowFullScreen='true' AllowScriptAccess='always' width='350' height='260' FlashVars='debug=&services_url=http://cdn-akm.vmixcore.com/core-flash/UnifiedVideoPlayer/services.xml&token=V0CuCNmu2y-DUmY
@csessig86
csessig86 / gist:3183418
Created July 26, 2012 17:42
Vmix > Fusion Table tutorial 0
var u = "http://cdn-akm.vmixcore.com/player/2.0/player.swf?player_id=48df95747124fbbad1aea98cee6e46e4";