Skip to content

Instantly share code, notes, and snippets.

View SalvaJ's full-sized avatar

SalvaJ€ SalvaJ

View GitHub Profile
#!/usr/bin/env python
#
# gexiv2 image Exif date fixer.
# Corey Goldberg, 2014
"""Recursively scan a directory tree, fixing dates
on all jpg/png image files.
Each file's Exif metadata and atime/mtime are all
@SalvaJ
SalvaJ / Classes training
Last active January 4, 2016 05:59
I don't understand this classes features in Python. >:(
>>> class IBAN:
ISOcode = ' '
checkDigits = '00'
class CCC:
bankCode = '0000'
branchCode = '0000'
checkBank = '0'
checkAccount = '0'
account = '0000000000'
@SalvaJ
SalvaJ / PruebaHilos.py
Created February 4, 2014 13:40
Prueba de colisión en el uso de fichero por hilos concurrentes.
#!/bin/env python3
# -*- coding: UTF-8 -*-
# Prueba de programacion con threads para evaluar los conflictos en acceso a ficheros.
import threading, time
# Se crea una subclase de Thread
class MiThread(threading.Thread):
def __init__(self, num):
threading.Thread.__init__(self)
@SalvaJ
SalvaJ / oauth2.py
Created March 19, 2014 09:56 — forked from s-shin/oauth2.py
#!/usr/bin/env python3
"""This module is a sample of the OAuth2 authentication by Python3"""
__version__ = "0.1.0"
__author__ = "shin (shin.hateblo.jp)"
__copyright__ = "(C) 2012 shin"
__email__ = "[email protected]"
__license__ = "Apache License 2.0"
__status__ = "Prototype"
@SalvaJ
SalvaJ / GoogleAPI.py
Last active June 7, 2016 13:47
Example making HTTP request to use Google API without api-client.It works in Python3 (tested ok in 3.3.5)
#!usr/bin/python3
# -*- coding: UTF-8 -*-
"""This module is a sample of the OAuth2 authentication by Python3"""
__version__ = "0.1.0"
__author__ = "shin (shin.hateblo.jp)"
__copyright__ = "(C) 2012 shin"
__email__ = "[email protected]"
__license__ = "Apache License 2.0"
@SalvaJ
SalvaJ / pdf_to_text_converter.py
Last active January 21, 2018 09:59
To unlock a pdf file using 'gs' in linux shell and convert the content to text
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This code is for being used with pdfminer last version (Python 2.x)
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
from cStringIO import StringIO
@SalvaJ
SalvaJ / Macro_Excel_To_Word_Fields
Created April 29, 2015 18:16
This macro VBA example creates a Word doc and fill Form Fiels
Sub OpenPINDoc()
'
' Open PIN Doc Macro for New TN Client
' This example creates a Word doc and fill Form Fiels
Dim xlApp As Object
Dim wdApp As Object
Dim xlString As String
Dim catString As String
Dim storString As String
Dim dotString As String