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:
license: gpl-3.0 |
const Application = ((d) => { | |
const privateVariable = 'Private content' | |
const __private = { | |
cache: () => { | |
this.link = d.querySelector('.link') | |
}, | |
bind: () => { | |
this.link.addEventListener('click', this.showContent, false) |
The difference between XYZ and TMS tiles and how to convert between them
Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles
ending in /0/0/0.png
or something. Sometimes if it's a script, it'll look like
&z=0&y=0&x=0
instead. Anyway, these are usually maps in Spherical Mercator.
Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.
Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.
# coding=utf-8 | |
import sys | |
import xml.etree.cElementTree as cElementTree | |
from pyquery import PyQuery | |
import multiprocessing as mp | |
import time | |
reload(sys) | |
sys.setdefaultencoding('utf-8') |
// from http://www.w3.org/TR/WCAG20/#relativeluminancedef | |
function relativeLuminanceW3C(R8bit, G8bit, B8bit) { | |
var RsRGB = R8bit/255; | |
var GsRGB = G8bit/255; | |
var BsRGB = B8bit/255; | |
var R = (RsRGB <= 0.03928) ? RsRGB/12.92 : Math.pow((RsRGB+0.055)/1.055, 2.4); | |
var G = (GsRGB <= 0.03928) ? GsRGB/12.92 : Math.pow((GsRGB+0.055)/1.055, 2.4); | |
var B = (BsRGB <= 0.03928) ? BsRGB/12.92 : Math.pow((BsRGB+0.055)/1.055, 2.4); |
#!/usr/bin/env python | |
''' | |
This code is adapted from the consensus best practice python Twitter feed | |
consumer that's been floating around for a while now on StackOverflow etc. | |
My only addition to speak of is TenminWriter. (A "tenmin" is ten minutes | |
worth of stream. It's just a convenient chunk; you might want to make it | |
shorter or longer.) | |
THERE ARE BUGS HERE. THIS IS BARELY TESTED. DO NOT TRUST IT. |
# !/bin/bash | |
# make sure homebrew is up-to-date and install some stuff | |
brew update | |
brew install postgres || brew upgrade postgres | |
brew install postgis || brew upgrade postgis | |
# if you dont have brew on your path yet | |
echo "export PATH=/usr/local/bin:$PATH" >> ~/.bash_profile | |
source ~/.bash_profile |