Skip to content

Instantly share code, notes, and snippets.

@jccovey
jccovey / import_tumblr_to_jekyll.rb
Created October 20, 2009 23:31 — forked from julesfern/import_tumblr_to_jekyll.rb
Quick script to import tumblr posts to jekyll markdown'd posts
#!/usr/bin/env ruby
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll.
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll
require 'rubygems'
require 'open-uri'
require 'nokogiri'
# Configuration
# Download all current FAA sectional GeoTIFFs (zipped)
import urllib, os, csv
from lxml.html.soupparser import fromstring
FAA_CHART_URL = 'http://aeronav.faa.gov/index.asp?xml=aeronav/applications/VFR/chartlist_sect'
BASE_CONTENT_URL = 'http://aeronav.faa.gov/'
DOWNLOAD_DIR = 'download'
data = urllib.urlopen(FAA_CHART_URL).read()
@dwins
dwins / find_nulls.py
Created March 28, 2011 19:18
test geoserver config using gsconfig.py
#! /usr/bin/env python
from geoserver.catalog import Catalog
cat = Catalog('http://host/geoserver/rest', 'user', 'password')
def internal_name(s):
return s.startswith("__") and s.endswith("__")
def check(x):
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active December 23, 2019 02:32
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@springmeyer
springmeyer / mapnik2.rb
Created May 20, 2011 21:42
mapnik2 homebrew formula
require 'formula'
class Mapnik2 < Formula
head 'http://svn.mapnik.org/trunk/', :using => :svn
homepage 'http://www.mapnik.org/'
depends_on 'pkg-config' => :build
depends_on 'scons' => :build
depends_on 'libtiff'
depends_on 'jpeg'
@gdiggs
gdiggs / comments.haml
Created June 10, 2011 20:57
multi-line haml comments
-# This comment can be
split up in multiple lines just
by indentation!
Mike
doesn't
like
these
comments
.
@iandees
iandees / gist:1215596
Created September 14, 2011 00:53
A script to keep an osm2pgsql database running with minutely diffs and osmosis.
#!/bin/bash
set -e
# Initialize timestamp with day of latest planet dump
# Setting to midnight ensures we get conistent data after first run
# osmosis --read-replication-interval-init
OSMOSIS_PATH=/home/iandees/osmosis-SNAPSHOT-r25995
OSMOSIS_WORKDIR=/home/iandees/.osmosis
OSM2PGSQL_PATH=/home/iandees/osm2pgsql
@ingenieroariel
ingenieroariel / geonode_restrict.py
Created November 22, 2011 19:40
Make all maps and layers private in a GeoNode
from geonode.core.models import AUTHENTICATED_USERS, ANONYMOUS_USERS
def restrict(item):
"""Works with GeoNode Map and Layer objects to disable unauthenticated access.
"""
item.set_gen_level(ANONYMOUS_USERS, item.LEVEL_NONE)
item.set_gen_level(AUTHENTICATED_USERS, item.LEVEL_READ)
def publish(item):
"""Works with GeoNode Map and Layer objects to enable unauthenticated access.
@frewsxcv
frewsxcv / simple_convert_image.sh
Created January 11, 2012 19:34
Taken from ami-07db196e to assist in OpenAerialMap workflow
#!/bin/sh
export GDAL_TIFF_INTERNAL_MASK=YES
nearblack -co TILED=YES -setmask -nb 0 -of GTiff -o ./prewarp.tif $1
gdalwarp -co TILED=YES -dstalpha -t_srs EPSG:4326 prewarp.tif warped.tif
rm prewarp.tif
gdal_translate -co TILED=YES -co JPEG_QUALITY=80 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -b 1 -b 2 -b 3 -mask 4 warped.tif final.tif
rm warped.tif
gdaladdo final.tif 2 4 8 16 32 64 128 256
mv final.tif ${1}_converted.tif
@frewsxcv
frewsxcv / gist:1628357
Created January 17, 2012 19:33 — forked from oeon/oam.sh
OAM batch script
#!/bin/sh
export GDAL_TIFF_INTERNAL_MASK=YES
for f in /media/LAR_HD/6Inch/*.tif
do
nearblack -co TILED=YES -setmask -nb 0 -of GTiff -o ./prewarp.tif $f
gdalwarp -co TILED=YES -dstalpha -s_srs EPSG:2229 -t_srs EPSG:4326 prewarp.tif warped.tif
rm prewarp.tif
gdal_translate -co TILED=YES -co JPEG_QUALITY=80 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -b 1 -b 2 -b 3 -mask 4 warped.tif final.tif