Skip to content

Instantly share code, notes, and snippets.

View voyeg3r's full-sized avatar

Sérgio Luiz Araújo Silva voyeg3r

View GitHub Profile
@voyeg3r
voyeg3r / gist:141674
Created July 6, 2009 20:55
instalar o inkscape 0.47 no linux educacional
#!/bin/bash
# Criado em:Seg 06/Jul/2009 hs 17:53
# Last Change: Seg 06/Jul/2009 hs 17:53
# vim:ft=sh:fdm=syntax:nu:
# Instituicao: cpqt
# Proposito do script: instalar o inkscape 0.47 no linux educacional
# Autor: Sérgio Luiz Araújo Silva
# site: http://vivaotux.blogspot.com
# para instalar manualmente siga este link
@voyeg3r
voyeg3r / bigfiles.py
Created August 11, 2009 17:52
bigfiles.py
#!/usr/bin/env python
# bigfiles.py - Generate a list of the largest files within a subdir
# Copyright (C) 2007 Dan Noe / isomerica.net
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@voyeg3r
voyeg3r / getpopular.py
Created March 2, 2010 15:12
getpopular - get popular tags from delicious
#!/usr/bin/env python
# # -*- coding: UTF-8 -*-
# Criado em:Ter 02/Mar/2010 hs 11:58
# Last Change: Ter 02 Mar 2010 18:18:43 BRT
# vim:ft=python:nolist:nu:
# Instituicao: none
# Proposito do script: pesquisar tags populares no delicious
# Autor: Sérgio Luiz Araújo Silva
# site: http://vivaotux.blogspot.com
@voyeg3r
voyeg3r / gist:319980
Created March 2, 2010 21:38
python - Le um arquivo delimitado e mostra os campos na tela.
""" Le um arquivo delimitado e mostra os campos na tela.
source: http://aprenda-python.blogspot.com/2008/10/exemplo-3-ler-arquivo-csv-e-mostrar.html
"""
import csv
print __doc__
f = csv.reader(open('fones.txt'), delimiter=';')
for [nome,nasc,fone] in f:
print 'nome=%s | nasc=%s | fone=%s' % (nome,nasc,fone)
@voyeg3r
voyeg3r / gist:322022
Created March 4, 2010 19:00 — forked from anonymous/gist:321909
Limpando o terminal no python
# source: http://stackoverflow.com/questions/517970/how-to-clear-python-interpreter-console
import os
def cls():
os.system(['clear','cls'][os.name == 'nt'])
# now, to clear the screen
cls()
@voyeg3r
voyeg3r / gist:322039
Created March 4, 2010 19:35
iterações com a biblioteca itertools
# First, import itertools:
# source: http://stackoverflow.com/questions/104420/how-to-generate-all-permutations-of-a-list-in-python
import itertools
# Permutation:
print list(itertools.permutations([1,2,3,4], 2))
[(1, 2), (1, 3), (1, 4),
(2, 1), (2, 3), (2, 4),
@voyeg3r
voyeg3r / gist:323655
Created March 6, 2010 12:03
apihelper python
#!/usr/bin/env python
# # -*- coding: UTF-8 -*-
# Criado em:Sáb 06/Mar/2010 hs 08:09
# Last Change: Sáb 06 Mar 2010 08:40:18 BRT
# vim:ft=python:nolist:nu:
# Instituicao: cpqt
# Proposito do script: apihelper - acesso à documentação dos módulos
# Autor: Sérgio Luiz Araújo Silva
# site: http://vivaotux.blogspot.com
@voyeg3r
voyeg3r / gist:325090
Created March 8, 2010 11:48
instalar codecs
#!/bin/bash
# Criado em:Qui 23/Abr/2009 hs 22:58
# Last Change: Qua 24 Fev 2010 09:49:54 BRT
# vim:ft=sh:fdm=syntax:nu:
# Instituicao: none
# Proposito do script: instalar codecs e outros programas no ubuntu karmic 9.10
# Autor: Sérgio Luiz Araújo Silva
# site: http://vivaotux.blogspot.com
# cabeçalho
@voyeg3r
voyeg3r / fibonacci.py
Created March 11, 2010 11:59
python - sequencia de fibonacci
#!/usr/bin/env python
# # -*- coding: UTF-8 -*-
# Criado em:Qui 11/Mar/2010 hs 08:19
# Last Change: Qui 11 Mar 2010 08:52:48 BRT
# vim:ft=python:nolist:nu:
# Instituicao: none
# Proposito do script: calcular sequencia de fibonacci
# Autor: Sérgio Luiz Araújo Silva
# site: http://vivaotux.blogspot.com
"""
@voyeg3r
voyeg3r / gist:329342
Created March 11, 2010 16:54
python - calculando o fatorial
#!/usr/bin/env python
# # -*- coding: UTF-8 -*-
# Criado em:Qui 11/Mar/2010 hs 13:34
# Last Change: Qui 11/Mar/2010 hs 13:34
# vim:ft=python:nolist:nu:
# Instituicao: <+nome+>
# Proposito do script: <+descreva+>
# Autor: <+seuNome+>
# site: <+seuSite+>