Skip to content

Instantly share code, notes, and snippets.

View mittmannv8's full-sized avatar

Cleiton Junior Mittmann mittmannv8

  • AvenueCode [https://www.avenuecode.com/]
  • Lisbon, Portugal
View GitHub Profile
{
"agreement_id": "02wHxT36m9JJWysEPfB2Z1",
"organization": "Worten",
"status": "SIGNED",
"title": "webhook test 4",
"description": "",
"creation": {
"created_at": "2024-04-15T12:58:21.950000Z",
"user": {
"name": "Programa Parcerias Worten",
@mittmannv8
mittmannv8 / .zshrc
Created May 16, 2024 10:42
.dot files
# FZF
# Set up fzf key bindings and fuzzy completion
source <(fzf --zsh)
export FZF_COMPLETION_TRIGGER='..'
export FZF_DEFAULT_OPTS="--multi --reverse --border --inline-info --preview '([ -e {} ] && (bat --color=always --style=numbers --line-range :300 {} {} || tree -C {} | head -20 ) || (echo {})) 2> /dev/null' --preview-window=right:40%:wrap"
#export FZF_DEFAULT_OPTS="--multi --reverse --border --inline-info --preview 'bat --color=always --style=header,grid --line-range :300 {}' --preview-window=right:40%:wrap"
export FZF_CTRL_R_OPTS="--no-preview"
@mittmannv8
mittmannv8 / tkinter_boilerplate.py
Last active February 18, 2024 21:25
Boilerplate for tkinter app
from tkinter import NO, Button, Entry, Frame, StringVar, Text, Tk
from tkinter.ttk import Treeview
from typing import TypedDict
class FormData(TypedDict):
scope: StringVar
FILELIST_HEADERS = ["filename", "date"]
import sys
from tkinter import E, Frame, Tk
TRANSPARENCY = 0.1
window = Tk()
root = window
root.configure(background='white')
import socket
from queue import Queue, Empty
from random import randint
from threading import Event, get_ident, Thread
class QueuedThreadProcess(Thread):
def __init__(self, queue, stop_event):
super().__init__()
self._queue = queue
@mittmannv8
mittmannv8 / loading.py
Last active February 17, 2024 11:48
Animated loading context
from threading import Thread, Event
from itertools import cycle
class Loading:
"""
Shows an animated loading message on screen while some long process is processing.
Args:
message(str): message
@mittmannv8
mittmannv8 / gist:45572eb91d936bb269e32180cfee5086
Last active May 20, 2020 16:22
threading_experiments.py
import time
import random
from concurrent.futures import ThreadPoolExecutor
import timeit
def fn(n):
print(n)
@mittmannv8
mittmannv8 / README.md
Created May 1, 2020 19:30
Script to get images from images.google.com

Get images from Google images

Search on Google the images dataset as you wish, copy the url and run the script as:

python get_images.py <path where images will be saved> <url copied from Google>
@mittmannv8
mittmannv8 / wordcount.py
Last active April 21, 2020 00:47
Desafio Refatoração na prática - Henrique Bastos
"""
13. wordcount
Este desafio é um programa que conta palavras de um arquivo qualquer de duas
formas diferentes.
A. Lista todas as palavras por ordem alfabética indicando suas ocorrências.
Ou seja...
@mittmannv8
mittmannv8 / python_cgi_restful.md
Created April 9, 2017 17:49
Exemple for apply restful routes in Python CGI with Nginx.

Snippet to apply Restful routes in Python CGI

Setting endpoint at nginx using regex

The syntax bellow match any route beginning with / api / and followed by any word and a iso format date, like /api/category/1999-01-01/

location ^~ /api/(\w+)/(\d{4}-\d{2}-\d{2})/$ {
   # Settings to Python CGI file
}