This file contains hidden or 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
# Generates request data payload to be sent as 'form-data' | |
REQUEST_FORM_DATA_BOUNDARY = "REQUEST_FORM_DATA_BOUNDARY" | |
FORM_DATA_STARTING_PAYLOAD = '--{0}\r\nContent-Disposition: form-data; name=\\"'.format(REQUEST_FORM_DATA_BOUNDARY) | |
FORM_DATA_MIDDLE_PAYLOAD = '\"\r\n\r\n' | |
FORM_DATA_ENDING_PAYLOAD = '--{0}--'.format(REQUEST_FORM_DATA_BOUNDARY) | |
REQUEST_CUSTOM_HEADER = { | |
'content-type': "multipart/form-data; boundary={}".format(REQUEST_FORM_DATA_BOUNDARY), | |
'Content-Type': "", | |
'cache-control': "no-cache" |
This file contains hidden or 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
import json, datetime | |
class RoundTripEncoder(json.JSONEncoder): | |
DATE_FORMAT = "%Y-%m-%d" | |
TIME_FORMAT = "%H:%M:%S" | |
def default(self, obj): | |
if isinstance(obj, datetime.datetime): | |
return { | |
"_type": "datetime", | |
"value": obj.strftime("%s %s" % ( |
This file contains hidden or 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
/* MAX7219 Interaction Code | |
* --------------------------- | |
* For more information see | |
* http://www.adnbr.co.uk/articles/max7219-and-7-segment-displays | |
* | |
* 668 bytes - ATmega168 - 16MHz | |
*/ | |
// 16MHz clock | |
#define F_CPU 16000000UL |