Skip to content

Instantly share code, notes, and snippets.

View danliberato's full-sized avatar

Daniel Liberato danliberato

  • Brazil
View GitHub Profile
@danliberato
danliberato / embedded_document_example.py
Created February 22, 2021 20:22
Save EmbeddedDocument example
from datetime import datetime
from src.models.invoice_model import InvoiceModel
from src.models.payment_info_model import PaymentInfoModel
from src.services.mongo_service import MongoService
### find invoice by taxId
inv = InvoiceModel.objects().get(tx_id='0d5bda0568df40c49066e570df86e511')
### There are two ways to update an EmbeddedDocumnet
### 1) change the fields without an auxiliary PaymentInfoModel
inv.payment_info.tx_id = "tx_id_example_1"
@danliberato
danliberato / ESP32_ILI9341_XPT2046.ino
Last active November 1, 2024 22:17
ESP32 controlling a (cheap chinese) ILI9341 TFT LCD via 8 bit parallel and the touch sensor via SPI
/*
* Hardware:
* - TFT LCD (SD card + touch) using ILI9341 via 8bit parallel interface: http://www.lcdwiki.com/3.2inch_16BIT_Module_ILI9341_SKU:MRB3205
* - ESP-WROOM-32 dev Board
*
* Wiring: just follow the pin definitios below
* NOTE: In order to make everything work you HAVE to solder the SMD resistor (actually it's a jumper) in 8bit position.
* */
#include <XPT2046_Touchscreen.h> //https://github.com/PaulStoffregen/XPT2046_Touchscreen