Skip to content

Instantly share code, notes, and snippets.

View tomahock's full-sized avatar

João Pina tomahock

View GitHub Profile
function remove_accents($string) {
if ( !preg_match('/[\x80-\xff]/', $string) )
return $string;
$chars = array(
// Decompositions for Latin-1 Supplement
chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
@tomahock
tomahock / distritos-concelhos-freguesias-Portugal.json
Last active November 1, 2020 10:33
Level 1 = Distrito, Level 2 = Concelho, Level 3 = Freguesia. Update de 12-07-2016
[
{
"level": 1,
"code": 1,
"name": "Aveiro"
},
{
"level": 2,
"code": 101,
"name": "Águeda"
@tomahock
tomahock / ssh.py
Created June 17, 2016 15:38
Get aws instances from terraform.tfstate and ssh to one of them
import json
import re
import os.path
from subprocess import call
def prompt(message, errormessage, isvalid):
res = None
while res is None:
res = input(str(message)+': ')
= X
:neo4j-version: 2.3.0
:author: Tomahock
:twitter: @tomahock
:style: red:ITEM(name)
== Introduction
xpto
= Contratos Públicos em Portugal
:neo4j-version: 2.3.0
:author: Tomahock
:twitter: @tomahock
:style: red:ENTIDADE(name) blue:EMPRESA(name)
== Introduction
Base de dados em grafo do site http://base.gov.pt
= Contratos Públicos em Portugal
:neo4j-version: 2.3.0
:author: Tomahock
:twitter: @tomahock
:style: red:ENTIDADE(name) blue:EMPRESA(name)
== Introduction
Base de dados em grafo do site http://base.gov.pt
= Contratos Públicos em Portugal
:neo4j-version: 2.3.0
:author: Tomahock
:twitter: @tomahock
:style: red:ENTIDADE(name) blue:EMPRESA(name)
== Introduction
Base de dados em grafo do site http://base.gov.pt

Keybase proof

I hereby claim:

  • I am tomahock on github.
  • I am tomahock (https://keybase.io/tomahock) on keybase.
  • I have a public key whose fingerprint is 66C1 5BAA 35D9 BED7 826B BA9E C23A C3B9 78F4 1990

To claim this, I am signing this object:

Verifying I am +tomahock on my passcard. https://onename.com/tomahock
@tomahock
tomahock / debian-locale
Created April 22, 2015 21:14
Solving debian locale problem
$ vi /etc/locale.gen
$ locale-gen
$ dpkg-reconfigure locales
$ export LC_CTYPE=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8