This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
''' | |
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. |
#!/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 |
/** | |
* 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++) { |
(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.