Skip to content

Instantly share code, notes, and snippets.

View tuaplicacionpropia's full-sized avatar

tuaplicacionpropia

View GitHub Profile
@tuaplicacionpropia
tuaplicacionpropia / apify-milanuncios.js
Created March 2, 2020 21:49
Forma sencillo de extraer un listado de datos paginados. Ver funciones loadItems y singleReadItem
// This is the main Node.js source code file of your actor.
// It is referenced from the "scripts" section of the package.json file.
const Apify = require('apify');
const readItem = () => {
var result = null;
result = $("div[class='aditem']").map(function() {
@tuaplicacionpropia
tuaplicacionpropia / get_date_image.py
Created July 15, 2018 19:52
Get Date of Photo/Image
#!/usr/bin/env python2.7
import sys
import locale
from PIL import Image
from PIL.ExifTags import TAGS
from datetime import datetime
@tuaplicacionpropia
tuaplicacionpropia / frame.py
Last active July 28, 2018 13:10
Gimp Frame Plugin
#!/usr/bin/env python
import random
from gimpfu import *
import sys
import locale
from PIL import Image
from PIL.ExifTags import TAGS
from datetime import datetime
@tuaplicacionpropia
tuaplicacionpropia / make_photo_look_better.py
Last active January 24, 2024 16:37
Python Fu GIMP: Make photo look better
#!/usr/bin/env python
#import gimp
#from pdb import *
#import math, struct
from gimpfu import *
# pdb.gimp_invert(layer)
@tuaplicacionpropia
tuaplicacionpropia / gimp_enfocar.py
Created June 30, 2018 07:59
GIMP Plugin: Enfocar
#!/usr/bin/env python
'''
Ok I finally got it working. I used the GIMP Python scripting to create a gimp plugin which can do a tonne of stuff including the layers you mentioned. Then you can just run gimp from the command line passing arguments to the python gimp script. The article Using Python-Fu in Gimp Batch Mode was an excellent resource for learning how to call gimp plugins from the command line. The example below will load the specified image into gimp, flip it horizontally, save and exit gimp.
flip.py is the gimp plug-in and should be placed in your plug-ins directory which was ~/.gimp-2.6/plug-ins/flip.py in my case.
flip.py
@tuaplicacionpropia
tuaplicacionpropia / heic2jpg.py
Created June 24, 2018 16:17
Convert HEIC to JPG (batch)
#!/usr/bin/env python
import os
from os import listdir
from os.path import isfile, join
mypath = os.path.dirname(os.path.realpath(__file__))
onlyfiles = [f for f in os.listdir(mypath) if os.path.isfile(join(mypath, f)) and f.endswith('.heic')]
print onlyfiles
@tuaplicacionpropia
tuaplicacionpropia / facade_casperjs.js
Last active March 27, 2018 06:35
Methods for use casperjs easyly
var casper = require('casper').create({
/*
clientScripts: [
'includes/jquery.js', // These two scripts will be injected in remote
'includes/underscore.js' // DOM on every request
],
*/
pageSettings: {
resourceTimeout: 3600000,
loadImages: true, // The WebPage instance used by Casper will
@tuaplicacionpropia
tuaplicacionpropia / character_godot.py
Last active March 19, 2018 23:16
Create Character from spritesheet to godot (special craftpix)
#!/usr/bin/env python
#coding:utf-8
from __future__ import print_function
from PIL import Image
import math
import os
import tempfile
import shutil
from threading import Thread
@tuaplicacionpropia
tuaplicacionpropia / spritesheet.py
Last active March 14, 2018 18:05
Create CUSTOM SPRITESHEET from multiple selected sprites and from multiple spritesheets
#!/usr/bin/env python
#coding:utf-8
from __future__ import print_function
from PIL import Image
import math
import os
import tempfile
import shutil
from threading import Thread