Skip to content

Instantly share code, notes, and snippets.

View gciotta's full-sized avatar

Giuseppe Ciotta gciotta

View GitHub Profile
from django.conf import settings
from django.core.cache import get_cache
from django.core.cache.backends.base import BaseCache
from django.contrib.sites.models import Site
from django.utils.encoding import smart_str
class CacheClass(BaseCache):
'''A wrapper around the django cache.
@gciotta
gciotta / gist:7766803
Created December 3, 2013 09:57
QT5 WebView to PDF printer
#!/usr/bin/env python3
import os
import sys
import argparse
from PyQt5.QtCore import QUrl
from PyQt5.QtPrintSupport import QPrinter
from PyQt5.QtWebKitWidgets import QWebView
from PyQt5.QtWidgets import QApplication
#
# This formatter creates log entries in this format:
# {"message": "my message", "severity": "INFO", "timestamp": {"seconds": 1518105845000, "nanos": 252}}
#
class StackdriverJSONFormatter(jsonlogger.JsonFormatter):
FORMAT_STRING = "{message}"
@gciotta
gciotta / keybase.md
Created June 21, 2018 19:00
keybase.md

Keybase proof

I hereby claim:

  • I am gciotta on github.
  • I am gciotta (https://keybase.io/gciotta) on keybase.
  • I have a public key ASDmb8P8AWgCKexYO2pyHmYmrujM2x42sQfsNemWgVMKfgo

To claim this, I am signing this object: