Skip to content

Instantly share code, notes, and snippets.

View TonyDiana's full-sized avatar

Tony Diana TonyDiana

  • Heredia, Costa Rica
View GitHub Profile
@johncrossland
johncrossland / Sphinx_with_Markdown.rst
Created December 12, 2018 00:28
Sphinx with Markdown - How to use Markdown with Sphinx (including Markdown tables that Sphinx does not handle by default for PDF and HTML output)

Sphinx with Markdown walkthrough for HTML and PDF output

This walkthrough installs Sphinx and configures it to output HTML and PDF from .md. If you install it on a VM, allocate over 25GB storage and multiple processors. You'll need Ubuntu 16.04 LTS, an internet connection, and sudo rights.

depth

2

@inazense
inazense / LectorXLSX.py
Created November 23, 2017 16:34
Lector ficheros XLSX con Python3
# -*- coding: utf-8 -*-
from openpyxl import load_workbook # Requiere instalar openpyxl
import os.path
rutaXLSX = "fichero.xlsx"
if os.path.isfile(rutaXLSX):
libro = load_workbook(rutaXLSX) # Abro el excel para extraer los campos
@inazense
inazense / googleMapsAPI.py
Last active February 20, 2021 05:09
Clase para trabajar con la API de Google Maps
# -*- coding: utf-8 -*-
import requests
import re # Usado para eliminar las etiquetas HTML de las response
class googleMapsAPI:
""" Clase para trabajar con la API de Google Maps """
# Propiedades
_clave = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # Escribe aquí to clave (puedes generarlas desde https://console.developers.google.com/apis/credentials)
@inazense
inazense / clonarRepositorio.py
Created September 24, 2017 22:35
Clona un repositorio GIT en Python usando GitPython
# -*- coding: utf-8 -*-
# Clono un repositorio online a mi disco duro local.
# Genero una carpeta en la que almacenaré, en diferentes subcarpetas, todas las ramas que vaya a necesitar clonar
# Posteriormente comprimo toda la clonación en un archivo .zip con la fecha actual del sistema.
# Si ya existiese dicho archivo lo sobrescribiré.
# Posteriormente borro las carpetas creadas para dejar solo el .zip
import git # Requiere librería GitPython
import time
@taoy
taoy / form.html
Created August 3, 2015 07:09
Python Bottle + WTforms + Polymer
%rebase layout title='Register New Slack log Box Backup configuration', parent_url=app.get_url('index')
<h2>Create New Slack Box backup</h2>
<script>
function submitForm(){
document.getElementById('authform').submit();
};
</script>
<!-- python block (bottle + wtforms) will not be appear in html-->
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active April 10, 2024 12:41 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@jampola
jampola / clock.py
Last active April 3, 2023 08:56
Simple clock using PyGTK and GObject.timeout_add()
#!/usr/bin/python
from gi.repository import Gtk, GObject
from datetime import datetime
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="app")
self.box = Gtk.Box(spacing=6)
self.add(self.box)
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@Natim
Natim / ini2json.py
Created January 11, 2013 10:21
Convert an ini configuration file into a json file
# -*- coding: utf-8 -*-
import json
import sys
from ConfigParser import (ConfigParser, MissingSectionHeaderError,
ParsingError, DEFAULTSECT)
class StrictConfigParser(ConfigParser):
def _read(self, fp, fpname):
@son-link
son-link / uptogit
Created March 28, 2011 17:37
Script para automatizar la actualización de un repositorio git
#!/bin/bash
# UpToGit 0.1
# Actualiza facilmente tu repositorio Git
# (CC) 2011 Alfonso Saavedra "Son Link"
# http://sonlinkblog.blogspot.com
# Bajo licencia GNU/GPL
# Modo de uso: copia o mueve este script a /usr/bin o /usr/local/bin y desde el directorio donde se encuentre la copia de un repo git, ejecútalo de esta manera:
# uptogit <ficheros>