Skip to content

Instantly share code, notes, and snippets.

View 0xbepresent's full-sized avatar

0xbepresent 0xbepresent

View GitHub Profile
@0xbepresent
0xbepresent / mock_datetime_object.py
Created January 10, 2015 16:29
Mock Datetime Object
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.
"""
@0xbepresent
0xbepresent / get_countries.py
Created July 21, 2014 19:20
Get a list of world's countries
# -*- 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')
@0xbepresent
0xbepresent / my_configs.vim
Last active August 31, 2017 02:07
My configs Mac-Vim
"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
@0xbepresent
0xbepresent / get_regiones_comunas.py
Created March 26, 2014 05:24
Obtiene un listado de objetos Regiones y Comunas con su relacion Region de Chile
# -*- 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
@0xbepresent
0xbepresent / ping_my_server.py
Last active December 24, 2015 10:29
PIng to my server!
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