start new:
tmux
switch inside tmux:
Ctrl + B + <command>
<?php | |
/* | |
* Script to count DNS queries for each domain associated to Cloudflare Account | |
* | |
* Params | |
* email Cloudflare Email | |
* token Cloudflare Global API Token | |
* start Start date in UTC ISO-8601 format Ex: 2017-10-20T00:00:00.000Z | |
* end End date in UTC ISO-8601 format | |
* domains (Optional) list of domains to compute DNS totals for; separate with comma. If this is empty, all domains will be checked. Ex: google.com,yahoo.com |
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.
<?php | |
/** | |
* This script shows that we need to add round() before applying floor() in the lat2tile() function. We also need to add (int) to avoid '-0' values. | |
* The bug is because PHP uses double-precision floating point numbers (https://stackoverflow.com/a/1863740/1094271) | |
*/ | |
$tiles = []; | |
//Demonstrating only till z3, you can increase if you like | |
for ($zoomLevel = 0; $zoomLevel <= 3; $zoomLevel++) { | |
$tiles[$zoomLevel] = getTilesCount($zoomLevel); |