Skip to content

Instantly share code, notes, and snippets.

@ryanbaumann
ryanbaumann / install-tippecanoe-on-windows.md
Last active April 11, 2024 13:20
Install Tippecanoe to make Mapbox Vector Tiles on a Windows 10 OS machine

Problem

Tippecanoe is an open source command line tool for creating Mapbox Vector Tiles. It runs only on unix environments like MacOS and Linux - so if you need to make maps with large vector data from geojson, shapefiles, or similar - you're hosed if you're on Windows.

Goals

  1. Create vector tiles of massive vector data on a Windows 10 machine

Requirements

@andreasonny83
andreasonny83 / README.md
Last active May 13, 2024 06:32
Readme template

npm version code style: prettier

Project Name

Write a project description

Prerequisites

This project requires NodeJS (version 8 or later) and NPM.

@aaronbloomfield
aaronbloomfield / multiple-php-versions-on-ubuntu-16.04.md
Last active July 9, 2020 01:53
Running multiple PHP versions on Apache2 and Ubuntu 16.04

Setting up multiple apache2 instances on Ubuntu 16.04

PHP handling on apache is done via modules of one sort or another, and running multiple version is problematic on a single instance. The solution is to run two instances of apache on the same machine. This allows one instance to run PHP 7 (the default on 16.04), and another can run PHP 5. Since normal http/https is on ports 80 and 443, the second instance will run on ports 81 and 444. Since it is running on the same machine, all file system and database access is the exact same.

All the commands herein have to be run as root, or with sudo prefixed to the command.

  1. Read /usr/share/doc/apache2/README.multiple-instances

  2. Run sh ./setup-instance php5 from /usr/share/doc/apache2/examples, where php5 is the suffix for the second site; all commands for the second site will have that suffix. This will keep all of the same configuration for all sites on the new instance, including SSL certif

@davej
davej / transitionToPromise.js
Last active January 31, 2023 15:49
Do a CSS transition and resolve promise when complete
const transitionToPromise = (el, property, value) =>
new Promise(resolve => {
el.style[property] = value;
const transitionEnded = e => {
if (e.propertyName !== property) return;
el.removeEventListener('transitionend', transitionEnded);
resolve();
}
el.addEventListener('transitionend', transitionEnded);
});
@joemaller
joemaller / webhook_validate.php
Last active November 20, 2021 12:29
Validate Github webhook signatures with PHP
<?php
$sig_check = 'sha1=' . hash_hmac('sha1', Request::getContent(), $_ENV['github_webhook_secret']);
if ($sig_check === Request::header('x-hub-signature')) { // php >=5.6 and above should use hash_equals() for comparison
// sigs match, do stuff
}