Skip to content

Instantly share code, notes, and snippets.

Avatar

Nelson do Vale Oliveira ndvo

View GitHub Profile
@ndvo
ndvo / .vimrc
Last active Sep 27, 2019
vimrc
View .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.
@ndvo
ndvo / csvmcmvagrega.py
Created Jun 3, 2018
Preparador de arquivos csv para mapas estáticos do SIMPR
View csvmcmvagrega.py
#!/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
View gist:76b61e8530dd35bff19f2a3cf61b428c
groups = [[],[],[]]
g = 0
for i in text:
if i.isnumeric:
groups[g]+=i
elif i in " -":
g+=1
View siorgphp.php
<?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;
}
@ndvo
ndvo / gen.py
Created Apr 15, 2019
Generate static website
View gen.py
#!/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')
View envia.py
#! /usr/bin/python
# -*- coding: utf-8 -*-
import codecs
import smtplib
import re
import os
import sys
import time
from email.header import Header
from email.mime.multipart import MIMEMultipart
View instaladrupal.sh
#! /bin/bash
prompt=">>>";
echo "Informe o arquivo que contém a lista de módulos (um por linha).
Se deixar em branco, modulos.csv será utilizado";
file_list="modulos.csv";
read file_list
history_url="http://updates.drupal.org/release-history/"
prefixo="DrupalScript";
echo "Informe a pasta a salvar os arquivos.
@ndvo
ndvo / android.sh
Created Jun 6, 2019
Prepare DWM for android dev
View android.sh
wmname LG3D
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
View background.sh
feh --bg-scale /usr/share/backgrounds/gnome/Icescape.jpg
You can’t perform that action at this time.