Skip to content

Instantly share code, notes, and snippets.

@TheBHump
TheBHump / type_join_query.json
Created November 22, 2011 19:04
Elasticsearch query structure for individualized type queries
{
'bool':{
'should':[
{
'filtered':{
'query':object_query,
'filter':{
'term':{
'_type':'object'
}
@TheBHump
TheBHump / black_to_transparent.py
Created August 26, 2011 22:13
Transparent Image Mashup
import Image
import sys
im = Image.open(open(sys.argv[1]))
im = im.convert("RGBA")
data = im.load()
width, height = im.size
for x in range(0,width):
for y in range(0,height):
if data[x,y] == (0,0,0,255):
@TheBHump
TheBHump / smtp_relay.py
Created August 17, 2011 19:03
SMTP->SES Relay Server
"""
SMTP->SES Relay Server
Author: Brian Humphrey, Loku.com
E-mail: [email protected]
Date: August 17, 2011
A Lightweight SMTP server that accepts all messages and relays them to SES
Credit to http://www.doughellmann.com/PyMOTW/smtpd/ for a tutorial on smtpd with asyncore
@TheBHump
TheBHump / smtp_relay.py
Created August 17, 2011 19:02
SMTP->SES Relay Server
"""
SMTP->SES Relay Server
Author: Brian Humphrey, Loku.com
E-mail: [email protected]
Date: August 17, 2011
A Lightweight SMTP server that accepts all messages and relays them to SES
Credit to http://www.doughellmann.com/PyMOTW/smtpd/ for a tutorial on smtpd with asyncore