Skip to content

Instantly share code, notes, and snippets.

View rburhum's full-sized avatar

Ragi Yaser Burhum rburhum

View GitHub Profile
@rburhum
rburhum / fabfile.py
Created June 19, 2012 17:31
Fabric script to compile FileGDB
from fabric.api import *
from fabric.contrib.console import confirm
import tempfile
import re
PROJ_VER='4.8.0'
GEOS_VER='3.3.3'
GDAL_VER='1.9.0'
PROJ_PATH='/usr/local/proj/' + PROJ_VER
@rburhum
rburhum / gist:4080308
Created November 15, 2012 18:30
Homebrew QGIS build failed
brew remove pyqt
brew install pyqt #verify everything works fine
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
brew tap homebrew/science
brew install qgis --with-grass --with-postgis
@rburhum
rburhum / urls.py
Created January 17, 2013 20:15
Add tilestache to Django
...
url(r'^v1/tiles/(?P<tile_user>([^/]+))/(?P<tile_layer>([^/]+))/(?P<tile_zoom>(\d+))/(?P<tile_column>(\d+))/(?P<tile_row>(\d+))\.(?P<tile_format>([a-z]+))$', TileManager.as_view(), name='tile_manager'),
...
#!/bin/sh
setup_brew () {
if ![-f "/usr/local/bin/brew"]; then
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
fi
}
setup_ipython () {
brew install readline
@rburhum
rburhum / README.md
Created May 14, 2017 02:24 — forked from mojodna/README.md
Chunk out NED ⅓arc second data using pyspark

To run this on EMR, do something akin to the following (with buckets changed as appropriate):

aws emr create-cluster \
  --name "NED Conversion" \
  --log-uri s3://ned-13arcsec.openterrain.org/logs/ \
  --release-label emr-4.0.0 \
  --use-default-roles \
  --auto-terminate \
 --ec2-attributes KeyName=stamen-keypair \
@rburhum
rburhum / download_sheet.py
Created March 30, 2020 17:08
Download a Google Sheet (or any Google Doc) to Colab VM using gspread
GOOGLE_SPREADSHEET_ID = '<ID_OF_YOUR_SPREADSHEET>' #e.g. 1klG4ihJRyesiWAI_Fq1mv-fErbXtXP4IoVmrJ9hij-k
from google.colab import auth
auth.authenticate_user()
import gspread
from oauth2client.client import GoogleCredentials
gc = gspread.authorize(GoogleCredentials.get_application_default())
@rburhum
rburhum / casos_positivos.py
Last active March 7, 2021 15:49
Procesar Casos positivos de datos abiertos (Perú) MINSA
from datetime import datetime
start_time = datetime.now()
import os
# Open data portal constants
OPENDATA_URL_CASOS_POSITIVOS = 'https://www.datosabiertos.gob.pe/dataset/casos-positivos-por-covid-19-ministerio-de-salud-minsa'
ALTERNATE_URL_CASOS_POSITIVOS = 'https://cloud.minsa.gob.pe/s/Y8w3wHsEdYQSZRp/download' # alternate URL from MINSA cloud service
DESTINATION_CASOS_POSITIVOS_RAW = './data/casos-positivos-raw.csv'
CASOS_POSITIVOS_CLEAN = './data/casos-positivos-utf8.csv'