This file contains hidden or 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
import datetime | |
import mock | |
real_datetime_class = datetime.datetime | |
def mock_datetime_now(target): | |
""" | |
A mock patch context, we override the datetime.datetime with a custom value. | |
""" |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Get a list of world's countries | |
@author: misalabs | |
""" | |
import requests | |
from bs4 import BeautifulSoup | |
# Get countries | |
countries_html = requests.get('http://es.wikipedia.org/wiki/Anexo:Pa%C3%ADses_del_mundo') |
This file contains hidden or 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
"Install Pathogen https://github.com/tpope/vim-pathogen | |
"Install Airline https://github.com/vim-airline/vim-airline | |
"Install Fugitive https://github.com/tpope/vim-fugitive | |
"Install Solarized https://github.com/altercation/vim-colors-solarized | |
"Helps to plugins installation | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Obtiene un listado de objetos de Regiones y Comunas con su relacion Region de | |
Chile | |
@author: misalabs | |
""" | |
import requests | |
from bs4 import BeautifulSoup | |
This file contains hidden or 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
import os, sys | |
if __name__ == "__main__": | |
# python ping_my_server.py misalabs.com | |
hostname = sys.argv[1] if len(sys.argv) == 2 else "misalabs.com" | |
end = False | |
while end is False: | |
response = os.system("ping -c 1 " + hostname) | |
if response == 0: | |
print "%s is up!" % hostname |
NewerOlder