Skip to content

Instantly share code, notes, and snippets.

@guybowden
guybowden / readme.md
Created April 29, 2019 09:35
simple simple notification service / simple queue service demo

Simple demo of pub and sub to the AWS notification and queue services:

Note: for some reason the queue is not being subscribed to the notification (have to go in and do it in the console).

Just run the two files in two terminals and watch as one program publishes events, whilst another one consumnes them.

Publish events:

$ python sns-pub.py
<?xml version="1.0" encoding="utf-8"?>
<gpx version="1.1" creator="Movescount - http://www.movescount.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.cluetrust.com/XML/GPXDATA/1/0 http://www.cluetrust.com/Schemas/gpxdata10.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd" xmlns:gpxdata="http://www.cluetrust.com/XML/GPXDATA/1/0" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns="http://www.topografix.com/GPX/1/1">
<rte>
<name>Untitled route</name>
<rtept lat="45.791789" lon="6.735023">
<ele>1960</ele>
</rtept>
<rtept lat="45.791755" lon="6.735064">
<ele>1960</ele>
@guybowden
guybowden / post-commit
Created August 29, 2017 13:45
Post commit hook to copy procfile if migrations are detected
#!/bin/sh
SRC_PATTERN="migrations/"
git show --name-only | if grep --quiet "$SRC_PATTERN"
then
cp Procfile_with_release Procfile
git commit . -m "Added release command since a migration file was modified or created."
fi
from base import *
SEARCH_INDEX = os.environ.get('SEARCH_INDEX', 'test_haystack')
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': os.environ.get('HAYSTACK_ENGINE', 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine'),
'URL': ELASTICSEARCH_URL,
'INDEX_NAME': SEARCH_INDEX,
'KWARGS': ELASTICSEARCH_KWARGS
},
[pytest]
python_paths=/app/seekr
DJANGO_SETTINGS_MODULE=seekr.settings.test_settings
norecursedirs=migrations node_modules bower_components src pages paypal dial lockdown threadedcomments
python_files=test_*.py tests.py
addopts = --reuse-db
[flake8]
exclude = migrations node_modules bower_components src pages paypal dial lockdown threadedcomments
@guybowden
guybowden / ion.rangeSlider.skinCSS3.css
Created October 9, 2014 13:27
Ion Rangeslider CSS3 Skin
.irs {
height: 40px;
margin:20px 0;
}
.irs-with-grid {
height: 60px;
}
.irs-line {
height: 10px; top: 33px;