Skip to content

Instantly share code, notes, and snippets.

View SamuelM333's full-sized avatar

Samuel Murillo SamuelM333

View GitHub Profile

Keybase proof

I hereby claim:

  • I am samuelm333 on github.
  • I am samuelm333 (https://keybase.io/samuelm333) on keybase.
  • I have a public key ASAAclRD98i6Vncs0pueHN4O0G0ZRpCugXOFzz-R7dMZmQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

To claim this, I am signing this object:

Manejo de Excepciones

Que es una excepción?

Anomalous or exceptional conditions requiring special processing.

Que es una excepción?

Ejemplos de excepciones

@SamuelM333
SamuelM333 / Vagrantfile
Created April 23, 2018 20:12
Vagrantfile using Docker and Docker Compose
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
# vagrant plugin install vagrant-docker-compose
# Provision Docker
config.vm.provision :docker
config.vm.provision :docker_compose, yml: "/home/vagrant/docker/docker-compose.yml", run: "always"
config.vm.define :mysite do |mysite|
mysite.vm.network :private_network, ip: "192.168.31.100"
mysite.vm.hostname = "mysite"
mysite.vm.synced_folder "docker/", "/home/vagrant/docker", create: true
import math
texto = "Aunque esta etapa se identifica con el uso de útiles de piedra tallada, también se utilizaron otras materias primas orgánicas para construir diversos artefactos"
ancho = 20
result = """
Aunque esta etapa se
identifica con el
uso de útiles de
piedra tallada,
también se
@SamuelM333
SamuelM333 / validar_entrada.py
Created July 12, 2016 15:11
Funcion recursiva que valida la entrada mediante expresiones regulares (Python 2)
import re
def validar_entrada(match, text, error):
"""Funcion recursiva que valida la entrada mediante expresiones regulares.
Recibe:
match: Expresion regular a buscar
text: Texto a mostrar en el input
error: Texto a mostrar cuando la expresion regular no encuentra nada
Retorna:
String con el texto que encontro la expresion regular. Si hubo un error, la funcion se vuelve a llamar