I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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
/** | |
* Generates number of random geolocation points given a center and a radius. | |
* @param {Object} center A JS object with lat and lng attributes. | |
* @param {number} radius Radius in meters. | |
* @param {number} count Number of points to generate. | |
* @return {array} Array of Objects with lat and lng attributes. | |
*/ | |
function generateRandomPoints(center, radius, count) { | |
var points = []; | |
for (var i=0; i<count; i++) { |
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
#!/usr/bin/env bash | |
# file: ~/.virtualenvs/postmkvirtualenv | |
# This hook is run after a new virtualenv is activated. | |
# setup python interpretor and sitepackages | |
# for Sublime Text's SublimeCodeIntel plugin. | |
# codeintel looks in the root of any folder opened via `subl foldername` | |
# for foldername/.codeintel/config | |
# it also looks in ~/.codeintel/config |
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
''' | |
PIL's Image.thumbnail() returns an image that fits inside of a given size (preserving aspect ratios) | |
but the size of the actual image will vary and is certainly not guaranteed to be the requested size. | |
This is often inconvenient since the size of the returned thumbnail cannot be predicted. The django-thumbs | |
library solves this for square thumbnails by cropping the image to a square and then resizing it. However, | |
this only works for exact squares. | |
This function generalizes that approach to work for thumbnails of any aspect ratio. The returned thumbnail | |
is always exactly the requested size, and edges (left/right or top/bottom) are cropped off to adjust to | |
make sure the thumbnail will be the right size without distorting the image. |