Skip to content

Instantly share code, notes, and snippets.

View turulomio's full-sized avatar
♦️
Focusing

turulomio turulomio

♦️
Focusing
View GitHub Profile
@turulomio
turulomio / 2019-https-localhost.md
Created April 20, 2021 07:05 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@turulomio
turulomio / gist:814ce8f8a3b75c864851edf3c7b62177
Created August 7, 2020 09:35
Migration from postgres to django
# No se permiten comillas dobles en la inserción a base de datos
import sys, psycopg2, psycopg2.extras, argparse, getpass
import os
import django
os.environ["DJANGO_SETTINGS_MODULE"] = 'dj_books.settings'
django.setup()
from books.models import *
from django.contrib.auth.models import User
class Mem:
@turulomio
turulomio / gist:96719a4d9cdfd459ae4b637ba53dbe3a
Created November 19, 2018 19:45
For QT unicode problems translations
print ("Mariano Muñoz © €".encode('unicode-escape'))
b'Mariano Mu\\xf1oz \\xa9 \\u20ac'
@turulomio
turulomio / gist:16ef3d283dd6bcedd481afeaf3885cdb
Created November 18, 2018 14:51
iCCP: known incorrect sRGB profile.
Curiosidades:
- En algunas imagenes al cargarlas me sal´ia Libpng warning: iCCP: known incorrect sRGB profile.
para evitarlo use imagemagic con el comando : convert document.png -strip document.png y se solucion´o el problema
@turulomio
turulomio / gist:db730ced9cb6608216408e468d659666
Last active December 1, 2018 05:30
Remember second function in or result it's not executed
def print_and_return(value):
print(value)
return(value)
print("True and False")
res= print_and_return(True) and print_and_return(False)
print("False and True")
res= print_and_return(False) and print_and_return(True)