If you do not have yay
installed, then follow these steps to install it first
yay
yay -S docker docker-compose
If you do not have yay
installed, then follow these steps to install it first
yay
yay -S docker docker-compose
import numpy as np | |
import os, sys, math | |
import matplotlib.pyplot as plt | |
import cv2 | |
import copy | |
def convert_image_to_BW(image): | |
bw_img = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | |
return cv2.cvtColor(bw_img, cv2.COLOR_GRAY2BGR) |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: iris-app | |
labels: | |
app: iris-app | |
tier: backend | |
version: v1 | |
spec: | |
selector: |
#!/usr/bin/env python3.6 | |
import os | |
import sys | |
from hashlib import md5 | |
from argparse import ArgumentParser | |
parser = ArgumentParser(description='Compare an S3 etag to a local file') | |
parser.add_argument('inputfile', help='The local file') | |
parser.add_argument('etag', help='The etag from s3') | |
args = parser.parse_args() |
# A simple example of using a QTimer to create a debounce on a line edit. | |
# For things like search fields, etc. | |
from PyQt5.QtCore import QTimer | |
from PyQt5.QtWidgets import QWidget, QLineEdit, QApplication, QVBoxLayout | |
class Widget(QWidget): | |
def __init__(self, parent=None): | |
super().__init__(parent) |
#!/bin/sh | |
# Author: Matt Holbrook-Bull | |
# Description: Tar and upload files to an AWS S3 bucket. Also backs up apache sites-available config files (take this out if you dont need it) | |
# Setup: you need to install the AWS CLI - http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html | |
# To run this automatically setup a root crontab job | |
# Will remove backups over 5 days old. Edit line 31/32 to adjust this retention period. | |
# alter these prefs to specify your S3 bucket location, local storage path on your server, and the source path of your required backups | |
DATE=`date +%d%m%y%H%M` | |
S3PATH=XXXXXX |
import unicodedata | |
import re | |
""" | |
A remoção de acentos foi baseada em uma resposta no Stack Overflow. | |
http://stackoverflow.com/a/517974/3464573 | |
""" | |
def removerAcentosECaracteresEspeciais(palavra): |
The following recipes are sampled from a trained neural net. You can find the repo to train your own neural net here: https://github.com/karpathy/char-rnn Thanks to Andrej Karpathy for the great code! It's really easy to setup.
The recipes I used for training the char-rnn are from a recipe collection called ffts.com And here is the actual zipped data (uncompressed ~35 MB) I used for training. The ZIP is also archived @ archive.org in case the original links becomes invalid in the future.
# Basic Dante Socks5 Setup, Debian | |
apt-get update | |
apt-get install make gcc | |
cd /usr/src | |
# get newest from http://www.inet.no/dante/download.html | |
wget http://www.inet.no/dante/files/dante-1.4.1.tar.gz |
import mimerender | |
mimerender.register_mime('pdf', ('application/pdf',)) | |
mimerender = mimerender.FlaskMimeRender(global_charset='UTF-8') | |
def render_pdf(html): | |
from xhtml2pdf import pisa | |
from cStringIO import StringIO | |
pdf = StringIO() | |
pisa.CreatePDF(StringIO(html.encode('utf-8')), pdf) |