Skip to content

Instantly share code, notes, and snippets.

View imaginabit's full-sized avatar

Fernando imaginabit

View GitHub Profile
@imaginabit
imaginabit / watermark image and text.py
Created October 10, 2019 10:33
take all the images in curret dir and subdirs and copy to targetdir with a watermark
import os
import re
import pathlib
myCmd = 'convert %s mark.gif +distort affine "0,0 0,0 %[w],%[h] %[fx:t?v.w*(u.h/v.h*0.9):s.w],%[fx:t?v.h*(u.h/v.h*0.9):s.h]" -shave 1 -gravity center -compose dissolve -define compose:args=\'40\' -composite ~/mark/%s'
targetDir = '/home/fer/mark'
watermark = '~/mark.gif'
filepath = 'imagelist.txt'
with open(filepath) as fp:
# pip install pyfcm
from pyfcm import FCMNotification
push_service = FCMNotification(api_key="< FIREBASE API KEY YOU FOUND IN PROYECT settings cloudmessaging/ >")
# OR initialize with proxies
@imaginabit
imaginabit / gitflowrebasing.md
Created February 22, 2019 20:34 — forked from markreid/gitflowrebasing.md
git flow with rebasing
@imaginabit
imaginabit / .git-commit-template.txt
Created January 15, 2019 13:21 — forked from elena/.git-commit-template.txt
This commit message template that helps you write great commit messages and enforce it across your team.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@imaginabit
imaginabit / centrar-divi-portfolio.js
Created May 3, 2017 19:32
Centre items in fullwitdh portfolio when they can fill the row
/* centra los portfolios */
jQuery(function() {
reorder_items = function() {
console.log("reorder");
var pf_total_items = 5;
if (jQuery(window).width() < 1599){
pf_total_items = 4;
}
if (jQuery(window).width() < 1025){
@imaginabit
imaginabit / Util Regular expresions to fix json
Last active July 5, 2016 10:36
Util Regular expresions
spanish characters:
[/:a-zA-ZáéíóúüñÑÁÉÍÓÚ@¿¡0-9_,.\-º ]+
== fix php serialize to json==
string
[ s]:[ 0-9]+:[ ]?"([:a-zA-ZéíóúüñÑÁÉÍÓÚ¿¡00-9_.,\- ]+)";[ s]:[ 0-9]+:[ ]*"([/:a-zA-ZáéíóúüñÑÁÉÍÓÚ@%¿¡0-9_,.\-º\(\);ª•=?!\n\r\t\\“”… ]*)";
[ s]:[ 0-9]+:[ ]?"([:a-zA-ZéíóúüñÑÁÉÍÓÚ¿¡00-9_.,\- ]+)";[ s]:[ 0-9]+:[ ]*"([/:a-zA-ZáéíóúüñÑÁÉÍÓÚ@%¿¡0-9_,.\-º\(\);ª•=?!\n\r\t\\“”…  ­ ]*)";
[ s]:[ 0-9]+:[ ]?"([:a-zA-ZéíóúüñÑÁÉÍÓÚ¿¡00-9_.,\- ]+)";[ a-z]:[ 0-9]+: "([\s\S]*)";
"$1": "$2",\n
@imaginabit
imaginabit / reblog_source_ranking.js
Created November 28, 2012 01:33
Show a Tubmlr top rebloged sources of current post
/*
You can see it in action here :
http://takurecortes.tumblr.com/post/36505473972/tumblr-hates-nic
just copy this in your tumblr theme html between <script></script> tags or use the raw option to get the file
*/
google.load("jquery", "1.3");
google.setOnLoadCallback(function() {
jQuery(function($) {
$(".notes").after("<div id='takuStats' style='border:1px solid black;background: #ddd;color:#000;padding:1em' >Clickme after load all notes</div>");