Project moved to https://github.com/ivanistheone/ccss_bookmarklet
Demonstrates use of event capture phase (as opposed to bubble phase, used by jQuery's bind) to prevent default trello click events if ALT key is depressed.
|<meta name="author" content="Gabriel Poirier" />|
|<meta name="author" content="Ivan Savov" />|
|<meta name="description" content="A tutorial on the use of HTML canvas element." />|
|from collections import defaultdict, namedtuple|
|from operator import itemgetter|
|// X and Y ranges of the graph|
|var X_RANGE = [-2, 10];|
|var Y_RANGE = [-35, 100];|
|// Width of the graph in pixels|
|// Let's use 400 for "normal" graphs and 170 for "small" graphs|
|var SIZE = 400;|
Write a program that runs a server that is accessible on http://localhost:4000/. When your server receives a request on http://localhost:4000/set?somekey=somevalue it should store the passed key and value in memory. When it receives a request on http://localhost:4000/get?key=somekey it should return the value stored at somekey. During your interview, you will pair on saving the data to a file.
|Simple DB server (key value store) that works over HTTP on localhost.|
|- GET /set?<key>=<value> Sets <key> to <value>|
|- GET /get?key=<key> Gets the value for key <key>|
Part of what makes python readable is the absence of type information, the indentation-based block structure for code, and a few Python idioms, also known as "syntax sugar" if you will.
This tutorial assumes the reader is familiar with other programming languages like Java and shows some examples of Python coolness.
I did some modifications to try to get it to work on Mac OS.