This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# # -*- coding: UTF-8 -*- | |
# Criado em:Qui 11/Mar/2010 hs 14:50 | |
# Last Change: Qui 11 Mar 2010 14:53:27 BRT | |
# vim:ft=python:nolist:nu: | |
# Instituicao: <+nome+> | |
# Proposito do script: <+descreva+> | |
# Autor: <+seuNome+> | |
# site: <+seuSite+> | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# opções para aleatoriedade em python | |
# fonte: python-brasil http://bit.ly/dAmCPC | |
# Se você estiver fazendo algo sério, e quiser uma implementação decente pra | |
# essa geração de um vetor aleatório, deveria usar o Numpy. | |
# | |
# Postei um benchmark das soluções propostas e adicionei uma utilizando o | |
# Numpy (http://paste.pocoo.org/show/187702/), seguem os tempos que deram para | |
# mim: | |
# | |
# Tempo total (teste #1): 10.1679s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# command line url-shorten | |
# by using ur1.ca | |
# $USER, Aug 2009 | |
if [ -z $1 ];then | |
echo "insira a url a ser abreviada": | |
read URL | |
LONG=$URL | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: http://stackoverflow.com/questions/2489731/convert-urls-into-html-links-using-sed | |
# Convert URLs into HTML links using sed? | |
sed -i.bakup 's|http.[^ \t]*|<a href="&">&</a>|' htmlfile | |
# a primeira dica: a troca do delimitador padrão pela barra vertical | |
# segunda dica, após o http ele pega o resto da linha exceto espaços e tabulações [^ \t] | |
# terceira dica: uma vez que o padrão vai para a memória do sed pode ser referenciada com o & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# você tem a seguinte entrada | |
<abc a="1"> | |
<val>0.25</val> | |
</abc> | |
<abc a="2"> | |
<val>0.25</val> | |
</abc> | |
<abc a="3"> | |
<val>0.35</val> | |
</abc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# exemplo de como retirar palavras que casam com um padrão | |
# e imprimir apenas o padrão, ou seja, não imprime as linhas | |
# para isto usa-se a opção '-o' --only-matching do grep | |
# no exemplo abaixo quero retirar apenas o que estiver entre apas | |
# fonte: http://goo.gl/HXpb | |
"word with quotes" other without, more text "new word", "more" | |
mais palavras com "aspas" para teste de "uso do grep" com a | |
opção "-o" que apenas retorna o padrão, no caso vou usar ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# exemplo de como retirar palavras que casam com um padrão | |
# e imprimir apenas o padrão, ou seja, não imprime as linhas | |
# para isto usa-se a opção '-o' --only-matching do grep | |
# no exemplo abaixo quero retirar apenas o que estiver entre apas | |
# fonte: http://goo.gl/HXpb | |
"word with quotes" other without, more text "new word", "more" | |
mais palavras com "aspas" para teste de "uso do grep" com a | |
opção "-o" que apenas retorna o padrão, no caso vou usar ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# scroll terminal baseado em python guake - F12 to open it | |
sudo aptitude install -y guake | |
gconftool-2 --install-schema-file /usr/etc/gconf/schemas/guake.schemas | |
# F11 togle full screen | |
# copy to clipboard Ctrl-shift-c | |
# past from clipboard Ctrl-shift-v | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Problema de crescimento populacional | |
# Desenvolvido por Evaldo Junior (InFog) | |
# http://infog.casoft.info | |
# Olá pessoal! | |
# | |
# Esses dias recebi um e-mail, do Diego Rodrigues, pedindo uma ajuda em Python. | |
# Ele mandou alguns probleminhas bem interessantes, mas a maioria relacionada à |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open your vim editor | |
To list wall symbols | |
:dig <enter> | |
to insert one symbol do | |
ctrl-k <char><char> |