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
"""Based on https://stackoverflow.com/a/38866913/23325241""" | |
import re | |
# Attempt to import requests and handle if it's missing | |
try: | |
import requests | |
requests_available = True | |
except ImportError: | |
requests_available = False |
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
/** | |
* Proxy for accessing ES6 Maps like objects. | |
* Usage example: | |
* | |
* var p = new MapProxy(); | |
* p['key'] = 'value'; | |
* if ('key' in p) { | |
* console.log(p.key); | |
* } | |
* delete p.key; |
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
/* USAGE | |
var graph = new Graph(paper.get(0), 800, 500); | |
graph.max(maxx, maxy) | |
.min(minx, miny) | |
.ticks(4, function(x, y){ | |
var attrs = {stroke: "#ffffff", 'stroke-width': '1'}; | |
graph.hor(y, attrs) | |
.ver(x, attrs); |