Skip to content

Instantly share code, notes, and snippets.

@brizzbane
brizzbane / gist:56dc3043d8ca0f0ec177
Last active August 29, 2015 14:26
serialization issue
__author__ = 'brizzbane'
from elasticsearch_dsl import DocType
from copy import deepcopy
from elasticsearch import Elasticsearch
from elasticsearch_dsl.connections import connections
connections.create_connection(hosts=['localhost'])
client = Elasticsearch()
class EmailDomain(DocType):
from Celery import Celery
app = Celery('tasks', broker='amqp://guest@localhost//', backend='amqp')
app.conf.CELERY_RESULT_BACKEND = 'amqp'
app.conf.CELERYD_LOG_COLOR = True
from elasticsearch_dsl import DocType
class Account(DocType):
@brizzbane
brizzbane / gist:276c7a54fe8e82cc516d
Created March 28, 2015 20:33
elasticsearch not indexing value
{
"socialnetwork:{
"properties":{
"found":{
"type":"boolean"
},
"member":{
"properties":{
"member_id":{
"type":"long"
@brizzbane
brizzbane / gist:5d275c46122cfa53cb8c
Last active August 29, 2015 14:12
phantomjs/ghostdriver session test
from selenium import webdriver
proxylist = ['127.0.0.1','127.0.0.2']
a = {}
for proxy in proxylist:
a[proxy] = webdriver.PhantomJS(executable_path='C:\Python27\selenium\phantomjs.exe',service_args=['--proxy=' + proxy + ':3128', '--proxy-type=http'])
a[proxy].set_window_size(1120, 550)
a[proxy].get("http://whatismyipaddress.com")
a[proxy].save_screenshot(proxy + '.png') #will always end up displaying 127.0.0.1 in screenshot, while creating both 127.0.0.1.png, and 127.0.0.2.png
print a[proxy].current_url