Skip to content

Instantly share code, notes, and snippets.

View natanfelles's full-sized avatar
💥
Hunting bugs!

Natan Felles natanfelles

💥
Hunting bugs!
View GitHub Profile
@natanfelles
natanfelles / .htaccess
Created November 25, 2017 02:09
Apache .htaccess - Use child folder as document root
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.tld$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]
@natanfelles
natanfelles / donations.md
Last active November 20, 2017 00:20
Markdown Donation Buttons

Donate

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](YOUR_EMAIL_CODE)

paypal

[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](YOUR_EMAIL_CODE)

@natanfelles
natanfelles / mdpopups.css
Created November 12, 2017 04:24
Sublime Markdown Popups Styles for Theme - One Dark
/**
* Sublime Markdown Popups Styles for Theme - One Dark
*
* @author Natan Felles <[email protected]>
*/
body {
background-color: #2f343f;
color: #abb2bf;
font-size: 0.9rem;
}
@natanfelles
natanfelles / nogap.php
Created July 29, 2017 16:41 — forked from artoodetoo/nogap.php
Efficient Geo IP location in MySQL database
#!/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"],
@natanfelles
natanfelles / parse_link_header.md
Last active January 31, 2025 14:31
Parse Link Header
@natanfelles
natanfelles / gist:f6999bc296a63af2881d9a68fc12945f
Created July 29, 2017 12:44 — forked from niallo/gist:3109252
Parse Github `Links` header in JavaScript
/*
* 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");
}
@natanfelles
natanfelles / header_link.php
Last active July 24, 2017 22:47
CodeIgniter 4 - Header Link Pagination
@natanfelles
natanfelles / serve.sh
Created July 18, 2017 19:38
Serve Jekyll According to Environment
#!/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
@natanfelles
natanfelles / estados-cidades.json
Created July 4, 2017 00:14 — forked from letanure/estados-cidades.json
JSON estados cidades
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",