Skip to content

Instantly share code, notes, and snippets.

View sergiogarciadev's full-sized avatar
I turn coffee into code (sometimes in bugs).

Sergio Garcia sergiogarciadev

I turn coffee into code (sometimes in bugs).
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib
import re
import sys
import base64
import subprocess
import urllib
import lxml.etree
@sergiogarciadev
sergiogarciadev / python-cli.sh
Created April 27, 2016 19:02 — forked from nepsilon/3-python-module-you-can-use-on-cli.md
3 Python modules you can use directly on the CLI
# Start a local webserver to serve the file of your current directory on the LAN:
# Python version 2.x:
python -m SimpleHTTPServer
# Python version 3.x:
python3 -m http.server
#Start a local SMTP server to debug your app emails. Emails will be printed on stdout:
python -m smtpd -c DebuggingServer -n
#Parse and prettify a JSON string with:
@sergiogarciadev
sergiogarciadev / bovespa_intraday.py
Created May 19, 2016 20:38 — forked from maurobaraldi/bovespa_intraday.py
Cotações da Bovespa Intraday
#!/usr/bin/env python
from datetime import datetime
from json import loads
from time import gmtime, mktime, strptime
# LevelDict é um wrapper usando dicionário para LevelDB
# https://github.com/maurobaraldi/leveldict
from leveldict import LevelJsonDict
from requests import get
@sergiogarciadev
sergiogarciadev / Build Packaged on Debian
Last active December 4, 2018 03:44
Install Vim 8 with Python, Python 3 and Lua support on Ubuntu 16.04
sudo apt update -qq
sudo apt remove --purge vim vim-common vim-runtime vim-gnome vim-tiny vim-gui-common vim-nox-py2
sudo apt install -y liblua5.1-dev luajit libluajit-5.1 python-dev python3-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
@sergiogarciadev
sergiogarciadev / http_proxy_connect.py
Created February 26, 2018 13:30 — forked from frxstrem/http_proxy_connect.py
Establish a socket connection through an HTTP proxy in Python.
'''
Establish a socket connection through an HTTP proxy.
Author: Fredrik Østrem <frx.apps@gmail.com>
License:
This code can be used, modified and distributed freely, as long as it is this note containing the original
author, the source and this license, is put along with the source code.
'''
@sergiogarciadev
sergiogarciadev / airports.json
Created October 30, 2018 01:26 — forked from tobiasburri/airports.json
Airport Data
This file has been truncated, but you can view the full file.
[{"City":"Postville","DBTZ":"A","Name":"Postville Airport","Country":"Canada","IATA/FAA":"YSO","Longitude":"-59.785278","ICAO":"CCD4","Airport ID":"7252","Latitude":"54.910278","Timezone":"223","DST":"-4","destinations":["5492","188","5502"]},{"City":"Osubi","DBTZ":"U","Name":"Warri Airport","Country":"Nigeria","IATA/FAA":"QRW","Longitude":"5.45","ICAO":"DNSU","Airport ID":"6972","Latitude":"5.31","Timezone":"50","DST":"1","destinations":["260","273"]},{"City":"Rockland","DBTZ":"A","Name":"Knox County Regional Airport","Country":"United States","IATA/FAA":"RKD","Longitude":"-69.0992303","ICAO":"KRKD","Airport ID":"4026","Latitude":"44.0601111","Timezone":"56","DST":"-5","destinations":["3448"]},{"City":"Jacksn Hole","DBTZ":"A","Name":"Jackson Hole Airport","Country":"United States","IATA/FAA":"JAC","Longitude":"-110.73775","ICAO":"KJAC","Airport ID":"4027","Latitude":"43.607333333","Timezone":"6451","DST":"-7","destinations":["3536","3751"]},{"City":"Flores","DBTZ":"U","Name":"Mundo Maya International","Count