Skip to content

Instantly share code, notes, and snippets.

View zstumgoren's full-sized avatar

Serdar Tumgoren zstumgoren

View GitHub Profile
@jeremyjbowers
jeremyjbowers / my_app.conf
Created December 31, 2012 01:29
This is an upstart configuration file to execute uWSGI as a daemon on Ubuntu-recent (10.x, 12.x). For more info on upstart: http://upstart.ubuntu.com/getting-started.html. This file would live in /etc/init/ and you'd need to do sudo initctl reload-configuration on the initial file creation and then sudo service my_app start/restart/stop to contr…
description "uWSGI server for electris CMS"
start on runlevel [2345] # start on all runlevels.
stop on runlevel [!2345] # stop when shutting down.
respawn # respawn if job crashes or is stopped ungracefully.
env DEPLOYMENT_TARGET=production # set any environment variables you like here.
env DJANGO_SETTINGS_FILE=conf/settings.py # more environment variables if you like.
env PYTHONPATH=/home/ubuntu/apps/my_app:/home/ubuntu/.virtualenv/my_app
@jasonbartz
jasonbartz / geo_no_db.py
Created April 1, 2013 20:34
Geo without a database
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.geometries import Point
# Get the DC voting districts shape (from the Census Bureau)
ds = DataSource('/path/to/my/shapefiles/tl_2012_11_vtd10/tl_2012_11_vtd10.shp')
# Grab the layer that contains all of the shape data
layer = ds[0]
def get_shape_contains(layer, geometry):
# Iterate over every shape
@jeremyjbowers
jeremyjbowers / varnish.vcl
Last active December 20, 2015 15:09
Basic Varnish configuration for Inspections project.
# Okay, so, let's start by setting up a backend.
# Varnish needs to know where to send requests
# that fail to find an object in the cache.
# We'll send requests back to Nginx on port 8001.
backend default {
.host = "127.0.0.1";
.port = "8001";
}
# Varnish has some subfunctions (subroutines?) that start
@jeremyjbowers
jeremyjbowers / varnish
Last active December 20, 2015 15:09
Basic Varnish configuration for /etc/default/varnish
# Oh, wow. So those other configuration files
# looked pretty readable. This one, though,
# looks OOOOOLLLD. It is old. And so it's
# less readable. But let's talk about it.
# Run on startup? Yes.
START=yes
# Set the number of files this daemon can
# touch. We need los of them because each
@briantjacobs
briantjacobs / storytelling_from_space.md
Last active August 28, 2024 07:14
Storytelling from Space

Storytelling from Space: Tools/Resources

This list of resources is all about acquring and processing aerial imagery. It's generally broken up in three ways: how to go about this in Photoshop/GIMP, using command-line tools, or in GIS software, depending what's most comfortable to you. Often these tools can be used in conjunction with each other.

Acquiring Landsat & MODIS

Web Interface

  • Landsat archive
@dannguyen
dannguyen / compjour-2016-WARN-pdfs-pdfplumber.md
Last active March 17, 2021 20:41
COMPJOUR examples of using pdfplumber on California WARN data

Using the pdfplumber library to extract tabular data from California's WARN Act data documents

(this writeup supplements a computational journalism assignment)

Jeremy Singer-Vine has been working on a new PDF-to-text/spreadsheet library native to Python: pdfplumber

The California WARN Act PDFs can be found at: