How do I do something like options kwarg JazzCore/python-pdfkit#222
options = {
"enable-local-file-access": True,
...
}
pdfkit.from_string(html_file, pdf_file, options=options, ...)
#!/usr/bin/env python | |
# | |
# Basic example of using Python3 and IMAP to read emails in a gmail folder/label. | |
# Remove legacy email.header api use. | |
import sys | |
import imaplib | |
import getpass | |
import email | |
import datetime |
/* | |
* Create Tables | |
*/ | |
CREATE TABLE IF NOT EXISTS `PREFIX_permissions` ( | |
`ID` int(11) NOT NULL auto_increment, | |
`Lft` int(11) NOT NULL, | |
`Rght` int(11) NOT NULL, | |
`Title` char(64) NOT NULL, | |
`Description` text NOT NULL, |
# | |
# Generated automatically from man.conf.in by the | |
# configure script. | |
# | |
# man.conf from man-1.6c | |
# | |
# For more information about this file, see the man pages man(1) | |
# and man.conf(5). | |
# | |
# This file is read by man to configure the default manpath (also used |
class Blog(django.model): | |
name = models.CharField(null=False, max_length=64) | |
def list_articles(self): | |
return [ | |
{'body': 'abcdefg'}, | |
{'body': 'abcdefg'}, | |
{'body': 'abcdefg'}, | |
] |
# sentry docs for filtering errors | |
# https://docs.sentry.io/platforms/python/guides/django/configuration/filtering/#event-hints | |
from django.urls import reverse_lazy | |
from django.db.utils import InterfaceError as djangoDbInterfaceError | |
... | |
def before_send(event, hint): | |
if 'exc_info' in hint: | |
exc_type, exc_value, tb = hint['exc_info'] |
<ion-view> | |
<ion-header-bar align-title="center" class="bar-dark"> | |
<div class="buttons"> | |
<button class="button button-icon icon ion-close" ng-click="goHome()"></button> | |
</div> | |
<h1 class="title">crop</h1> | |
</ion-header-bar> | |
<!-- | |
<div class="header-padding"></div> | |
--> |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'verbose': { | |
'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}', | |
'style': '{', | |
}, | |
}, | |
'handlers': { |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'filters': { | |
'slow_queries': { | |
'()': 'django.utils.log.CallbackFilter', | |
# output slow queries only, unit are 1s, so 0.3 is 300ms | |
# ref 300ms * 0.001 = 0.3, 50ms * 0.001 = 0.05 | |
'callback': lambda record: record.duration > 0.05 | |
}, |
How do I do something like options kwarg JazzCore/python-pdfkit#222
options = {
"enable-local-file-access": True,
...
}
pdfkit.from_string(html_file, pdf_file, options=options, ...)
#!/bin/bash | |
hosts() { | |
VALID_COMMANDS=("help" "show" "samplefile" "activate" "deactivate") | |
NO_ARG_COMMANDS=("help" "show" "samplefile") | |
GREEN='\033[0;32m'; | |
RED='\033[0;31m'; | |
NOCOLOR='\033[0m'; | |
read -r -d '' SAMPLE_ETC_HOSTS_FILE <<HEREDOC |