This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Place this in the Apperance -> Custom Include Tags Page --> | |
<!-- ReadMe.io glue script for Segment --> | |
<script type="text/javascript"> | |
// Content is loaded via ajax - this means normal js embed will not work. | |
// Instead, we check for a completed ajax event of type GET | |
// Similarly, we need to refresh on-page variables | |
// This event is fired a half second after document ready to give title tag time to refresh | |
$(document).ajaxComplete(function(event,xhr,settings){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fba_locations = {'*XFR': {'address': '2021 7th Avenue', | |
'city': 'Seattle', | |
'code': '*XFR', | |
'notes': '', | |
'state': 'WA', | |
'zip': '98121'}, | |
'ABE1': {'address': '705 Boulder Dr', | |
'city': 'Breinigsville', | |
'code': 'ABE1', | |
'notes': '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################ | |
########## WHY & How ########### | |
################################ | |
# I had written a query inside of a loop that pulled results for every day | |
# This was very ineffecient | |
# While I belive this could be solved with a MongoDB Aggrigation, the syntax seemed complicated | |
# I could not find good examples for what I needed to do (aggrigate results of a day based on timestamp in one query) | |
# This is likely due to my ignorance | |
# Nonetheless, I thought this method may be helpful to someone else having the same issues as me | |
# Finally, dealing with nested dictionaries in python is slightly difficult as a nested key needs to be added with 'update' |