Skip to content

Instantly share code, notes, and snippets.

View kerenskybr's full-sized avatar
🤖
___

Roger Monteiro kerenskybr

🤖
___
View GitHub Profile
@kashifulhaque
kashifulhaque / docker-arch.md
Last active January 30, 2025 22:10
How to install Docker and Docker Compose on Arch Linux

If you do not have yay installed, then follow these steps to install it first

Update

yay

Install

yay -S docker docker-compose
@RoshanTanisha
RoshanTanisha / face_detection_using_opencv.py
Last active October 3, 2020 14:56
Simple script to detect face from camera using OpenCV
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)
@canhtran
canhtran / iris-api-depployment.yaml
Created September 2, 2019 03:11
Iris flower data deployment for k8s / medium post
apiVersion: apps/v1
kind: Deployment
metadata:
name: iris-app
labels:
app: iris-app
tier: backend
version: v1
spec:
selector:
@tgardiner
tgardiner / aws_s3_etag_local_compare.py
Created January 13, 2019 02:52
Compare AWS S3 Etag to local file
#!/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()
@chipolux
chipolux / debounce.py
Created August 22, 2017 17:09
pyqt debounced text input
# 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)
@matthbull
matthbull / backup_to_s3.sh
Created January 6, 2016 10:17
Tar and sync compressed files to an Amazon Web Services S3 bucket.
#!/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
@boniattirodrigo
boniattirodrigo / removerAcentosECaracteresEspeciais.py
Last active December 28, 2023 18:38
Remover acentos e caracteres especiais em Python
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):
@nylki
nylki / char-rnn recipes.md
Last active November 18, 2024 13:19
char-rnn cooking recipes

do androids dream of cooking?

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.

@Fire-
Fire- / installDante.sh
Created October 3, 2014 19:53
Basic Dante Socks5 Server Setup and Configuration
# 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
@philfreo
philfreo / html2pdf.py
Created June 21, 2013 22:50
A Flask view that returns HTML or generates a PDF
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)