Skip to content

Instantly share code, notes, and snippets.

View striveforbest's full-sized avatar

Alex Zagoro striveforbest

View GitHub Profile
@striveforbest
striveforbest / wagtail_search_variables.txt
Last active February 4, 2017 02:50
WagtailSearch UnicodeDecodeError if using with AWS ElasticSearch and Page.title has special characters referenced variables
In [1]: message_body
Out[1]: '{"index": {"_type": "wagtailcore_page_americana_tenantpage_americana_storepage", "_id": "wagtailcore_page_americana_tenantpage:71", "_index": "wagtail__wagtailcore_page"}}\n{"live_filter": true, "depth_filter": 5, "owner_id_filter": null, "first_published_at_filter": "2016-05-06T16:49:57.236588+00:00", "content_type": ["americana.StorePage", "americana.TenantPage", "wagtailcore.Page"], "id_filter": 71, "content_type_id_filter": 83, "title": "Prada", "path_filter": "00010002000400020002", "latest_revision_created_at_filter": "2016-10-31T21:39:57.953628+00:00", "_partials": ["Prada"], "pk": "71", "locked_filter": false, "show_in_menus_filter": false, "americana_tenantpage__is_wheatley_plaza_tenant_filter": true}\n{"index": {"_type": "wagtailcore_page_americana_tenantpage_americana_storepage", "_id": "wagtailcore_page_americana_tenantpage:103", "_index": "wagtail__wagtailcore_page"}}\n{"live_filter": true, "depth_filter": 5, "owner_id_filter": null, "first_published_at_filter": "201
@striveforbest
striveforbest / wagtail_search_traceback.txt
Last active February 4, 2017 02:50
WagtailSearch UnicodeDecodeError if using with AWS ElasticSearch and Page.title has special characters
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/striveforbest/venv/americana/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/Users/striveforbest/venv/americana/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/striveforbest/venv/americana/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/striveforbest/venv/americana/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
@striveforbest
striveforbest / beautiful_idiomatic_python.md
Created February 26, 2016 19:01 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]: