- https://en.wikipedia.org/wiki/Great-circle_distance#Formulas
- http://www.geodatasource.com/developers/php
- http://www.codexworld.com/distance-between-two-addresses-google-maps-api-php/
- https://stackoverflow.com/questions/10053358/measuring-the-distance-between-two-coordinates-in-php
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
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^domain.tld$ [NC,OR] | |
RewriteCond %{HTTP_HOST} ^www.domain.tld$ | |
RewriteCond %{REQUEST_URI} !public/ | |
RewriteRule (.*) /public/$1 [L] |
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
/** | |
* Sublime Markdown Popups Styles for Theme - One Dark | |
* | |
* @author Natan Felles <[email protected]> | |
*/ | |
body { | |
background-color: #2f343f; | |
color: #abb2bf; | |
font-size: 0.9rem; | |
} |
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 | |
/* | |
* Filter to fill the IP gaps in a MaxMind GeoLite tables. | |
* | |
* For every missing range in the file it puts a dummy one. | |
*/ | |
$types = [ | |
'asnum' => [0, 0, 1, "%s,%s,\"-\"\n"], | |
'blocks' => [2, 0, 1, "\"%s\",\"%s\",\"1\"\n"], |
- http://tools.ietf.org/html/rfc5988
- https://developer.github.com/v3/#pagination
- https://gist.github.com/niallo/3109252
function parse_link_header(header) {
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
/* | |
* parse_link_header() | |
* | |
* Parse the Github Link HTTP header used for pageination | |
* http://developer.github.com/v3/#pagination | |
*/ | |
function parse_link_header(header) { | |
if (header.length == 0) { | |
throw new Error("input must not be of zero length"); | |
} |
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 | |
/** | |
* CodeIgniter 4 - Header Link Pagination | |
* | |
* Usage: | |
* | |
* $this->response->setHeader('Link', $pager->links('default', 'header_link')) | |
* | |
* @author Natan Felles <[email protected]> | |
* @link https://gist.github.com/natanfelles/9f4ccf4d10dd0dbf72599b26bd11ec0a |
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/bash | |
# Author: Natan Felles <[email protected]> | |
# Description: Serve Jekyll According to Environment | |
echo -n "Environment [d = development, p = production]: " | |
read ENV | |
rm -r .sass-cache/ | |
rm -r _site/ | |
rm .jekyll-metadata |
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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |