- CAP Theorem problem
- Partition tolerance will fail as a result of network connections
- This solution maximises for availability of data
- The assumption here is that the consistency of data is less important
- Users need to be logged in to make changes
- Sync server is responsible for reducing events
- Two solutions proposed
- If no newsfeed or watching other users is required, a movie's favourites are only retrieved when a movie is read
- If watching other users is required, the solution is more fragile, and should probably result in a push from the server to the device to ensure a proper success response code (which isn't possible in the case of the server getting the results)
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
#!/bin/sh | |
# Use this as the command for the user script | |
# curl https://gist.githubusercontent.com/aaronromeo/a683c9810aad108fab2ae6b3bc583372/raw/medusa.sh | sh | |
# add docker | |
sudo apt update | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" |
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
FROM cypress/included:3.3.0 | |
RUN apt-get update && apt-get install -y wget | |
ENV DOCKERIZE_VERSION v0.6.1 | |
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | |
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | |
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | |
RUN npm install [email protected] |
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
{ | |
"attachment":{ | |
"type":"audio", | |
"payload":{ | |
"url":"https://petersapparel.com/bin/clip.mp3" | |
} | |
} | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Field conversion using the django rest framework
has not been overly intuitive. This might help
- to_native - Object -> End User (json)
- This is used to convert a complex object to a primitive Python types
- from_native - End User (json) -> Object
- This is used to convert primitive Python types to a complex object
Also see this example from the documentation.
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
from django.core.mail import EmailMessage | |
email = EmailMessage( | |
# subject='', | |
# body='', | |
from_email='[email protected]', | |
to=['[email protected]', '[email protected]'], | |
bcc=['[email protected]'], | |
headers={ | |
'X-MC-Template': 'template-slug', |
Working though some stuff with shell plus I had a multi-line function that I needed to debug. I came across %cpaste
which is a handy magic function exposing the capability to be able to drop a block of code into ipython
or shellPlus
.
NewerOlder