Back up your gists: update YOUR_USERNAME
and YOUR_PASSWORD
and run it. Requires
sudo pip install requests
I use this mainly to be able to quickly search through my thousands of Gists with a tool like ack or ag.
// 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); |
# 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') |
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.
const Application = ((d) => { | |
const privateVariable = 'Private content' | |
const __private = { | |
cache: () => { | |
this.link = d.querySelector('.link') | |
}, | |
bind: () => { | |
this.link.addEventListener('click', this.showContent, false) |
license: gpl-3.0 |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# ----------------------------------------------------------------------------- | |
# Copyright INRIA | |
# Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr) | |
# | |
# DANA is a computing framework for the simulation of distributed, | |
# asynchronous, numerical and adaptive models. | |
# | |
# This software is governed by the CeCILL license under French law and abiding |
#!/bin/sh | |
# Output file for HTML5 video | |
# requirements: ffmpeg .6+ | |
# usage: ./html5video.sh infile.mp4 640x360 | |
target_directory='converted' | |
file=`basename $1` | |
filename=${file%.*} | |
filepath=`dirname $1` |