Skip to content

Instantly share code, notes, and snippets.

@ndvo
ndvo / gen.py
Created April 15, 2019 00:04
Generate static website
#!/usr/bin/env python3
import os
import re
def truncate_html_words(s, num, delimiter):
length = int(num)
if length <=0:
return ''
html4_singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', 'hr', 'input')
<?php
function sam_siorg_client(){
$SIORG = new SoapClient("http://www.siorg.redegoverno.gov.br/gestao/webservice/WSSiorg.asmx?WSDL",
array('proxy_host'=>"10.1.101.101",
'proxy_port'=>8080,
));
return $SIORG;
}
groups = [[],[],[]]
g = 0
for i in text:
if i.isnumeric:
groups[g]+=i
elif i in " -":
g+=1
:w |!php %
@ndvo
ndvo / csvmcmvagrega.py
Created June 3, 2018 23:59
Preparador de arquivos csv para mapas estáticos do SIMPR
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xlrd #leitor de arquivos em excel
import csv #lidar com arquivos em csv
import os # lidar com o sistema operacional (pastas e arquivos)
import sys # lidar com diferentes sistemas operacionais (linux e windows)
import codecs # lidar com difirentes codificações de caracteres
import cStringIO
@ndvo
ndvo / .vimrc
Last active September 27, 2019 09:31
vimrc
let mapleader = " "
set backupdir=.backup/,~/.backup/,/tmp//
set directory=.swp/,~/.swp/,/tmp//
set undodir=.undo/,~/.undo/,/tmp//
set undofile
packloadall " Load all plugins.
silent! helptags ALL " Load help files for all plugins.