- XSS Protection
- Application Design
- CSRF Token
- CORS Header
- `Sub-Resource Integrity`_ W3C
- HSTS_ HTTP Strict Transport Security
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
| def query(endpoint, token): | |
| import json | |
| import requests | |
| headers = {'Authorization': 'Token %s' % (token)} | |
| http = requests.get(endpoint, headers=headers) | |
| response = json.loads(http.text) | |
| next = response['next'] | |
| result = response['results'] | |
| while(next): |
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 Image | |
| import base64 | |
| import StringIO | |
| output = StringIO.StringIO() | |
| im = Image.open("test.png") # Your image here! | |
| im.save(output, format='PNG') | |
| output.seek(0) | |
| output_s = output.read() | |
| b64 = base64.b64encode(output_s) | |
| open("test.html","w+").write('<img src="data:image/png;base64,{0}"/>'.format(b64)) |
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 io | |
| from django.http import HttpResponse | |
| import matplotlib.pyplot as plt | |
| def graph_view(request): | |
| image_file = io.BytesIO() | |
| plt.scatter([1, 2, 3, 4], [6, 10, 12, 1]) |
I hereby claim:
- I am aneumeier on github.
- I am andreasn (https://keybase.io/andreasn) on keybase.
- I have a public key whose fingerprint is 01F6 E873 6847 85BE 0814 1866 7262 F9F8 3240 B159
To claim this, I am signing this object:
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
| #!/usr/bin/env python3.7 | |
| #-*- coding: utf-8 | |
| # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai | |
| """ | |
| Docstrings use ReStructuredText | |
| """ |