Skip to content

Instantly share code, notes, and snippets.

from gzip import GzipFile
from io import BytesIO
import urllib2
from uuid import uuid4
import gdal
def open_http_query(url):
try:
request = urllib2.Request(url,
from disco.worker.classic.func import task_output_stream
class S3LineOutput(object):
"""
Output stream for S3.
key from each reduce becomes key name in S3
If gzip param is True, it gzips before uploading.
AWS_KEY, AWS_SECRET and BUCKET_NAME in params is required.
"""
def __init__(self,stream,params,partition, url):
@johntut
johntut / setup.py
Created July 20, 2015 01:28
f2py setup.py
import glob
import os
class NoNumpy(Exception):
pass
try:
from numpy.distutils.core import Extension
from numpy.distutils.core import setup
#!/bin/bash
#Iterate over a bunch of census shapefiles
#Extract only the fields of interest and reproject into
#wgs84
for f in $(find . -name "*.shp"); do
p=$f
[[ "$p" == */* ]] || p="./$p"
fname="${p##*/}"
layer="${fname%%.*}"
outfile="./FixedShapefiles/$layer.shp" # Outfile name
@johntut
johntut / unreal_snoop.patch
Created February 7, 2018 23:42
unreal patch for snooping on users
From 55433865208f46c509770f4a2557a272ce3df2de Mon Sep 17 00:00:00 2001
From: john <john>
Date: Tue, 7 Mar 2017 09:08:17 -0800
Subject: [PATCH] snooping
---
src/modules/m_message.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/modules/m_message.c b/src/modules/m_message.c