This process outlines the process for creating Cloud Optimised Geotiffs suitable for hosting in services such as AWS S3. COGs enables more efficient workflows use cases such as fast access from Functions as a Services (E.g AWS Lambda), or comsumption into client desktop GIS systems (e.g QGIS). For more details on COGs please see https://www.cogeo.org/in-depth.html
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 php | |
<?php | |
require 'SebastianBergmann/FinderFacade/autoload.php'; | |
require 'TheSeer/fDOMDocument/autoload.php'; | |
use SebastianBergmann\FinderFacade\FinderFacade; | |
use TheSeer\fDOM\fDOMDocument; | |
$input = new FinderFacade(array($argv[1]), array(), array('*.xml')); | |
$output = $argv[2]; |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "raring64" | |
config.vm.hostname = "docker" | |
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box" |
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
#!/bin/sh | |
AGENT_URL=http://puppetlabs.com/downloads/puppet/puppet-2.7.14.tar.gz | |
FACTER_URL=http://puppetlabs.com/downloads/facter/facter-1.6.9.tar.gz | |
apt-get update | |
apt-get -y install ruby rake rubygems | |
cd /tmp | |
wget ${FACTER_URL} -O /tmp/facter.tar.gz |
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 | |
printf "\033c" |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
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
<?php | |
class PhpErrorException extends \Exception{ | |
public function __construct($message = "", $code = 0, $file = '', $line = '', Exception $previous = null) | |
{ | |
$this->file = $file; | |
$this->line = $line; | |
parent::__construct($message, $code, $previous); | |
} | |
} |
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
backend default { | |
.host = "domain.com"; | |
.port = "8000"; | |
} | |
sub vcl_recv { | |
if (req.request == "PURGE") { | |
if (!client.ip ~ purge) { | |
error 405 "Not allowed."; |
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
<?php | |
function prettyDate($date){ | |
$time = strtotime($date); | |
$now = time(); | |
$ago = $now - $time; | |
if($ago < 60){ | |
$when = round($ago); | |
$s = ($when == 1)?"second":"seconds"; | |
return "$when $s ago"; | |
}elseif($ago < 3600){ |
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
<?php | |
/** | |
* MultiCurl class library is a PHP solution for work with MULTI CURL extension. | |
* It provides to execute some parallel HTTP requests with limit of downloaded | |
* size. Example: start 100 downloads with 2 parallel sessions, and get only | |
* first 100 Kb per session. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either |
NewerOlder