Skip to content

Instantly share code, notes, and snippets.

View matefs's full-sized avatar
💭
Let's chat on LinkedIn

Mateus Schverz matefs

💭
Let's chat on LinkedIn
View GitHub Profile
@matefs
matefs / react-mui-on-html.html
Created September 16, 2024 13:53
How to run react and mui.js using babel and html tags
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - React Material UI Template</title>
</head>
<body>
@matefs
matefs / real-time-bitcoin-pricing-jabascript-websocket.js
Created August 26, 2024 15:06
bitcoin pricing real time ( binance api websocket api )
const socket = new WebSocket('wss://stream.binance.com:9443/ws/btcusdt@trade');
socket.onmessage = (event) => {
const data = JSON.parse(event.data);
const btcPriceUSD = parseFloat(data.p);
console.log("Bitcoin pricing in USD (WebSocket):", btcPriceUSD);
};
// code tested and working in 26/08/2024
@matefs
matefs / docker_wordpress.md
Created July 31, 2024 12:31 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@matefs
matefs / html-to-pdf-python-convertion.py
Created April 26, 2024 11:44
html-to-pdf-python-convertion.py
import pdfkit
def html_to_pdf(html_content, pdf_file):
try:
pdfkit.from_string(html_content, pdf_file)
print("PDF conversion successful!")
except Exception as e:
print(f"PDF conversion failed: {str(e)}")
if __name__ == "__main__":
@matefs
matefs / auto focus prompt field chatgpt and bard.md
Created November 12, 2023 20:04
auto focus prompt field chatgpt and bard
@matefs
matefs / for in for of.md
Created October 12, 2023 17:29
for-in e for-of

For in

const person = {
    name: 'John',
    age: 30,
    city: 'New York'
};

for (let key in person) {
@matefs
matefs / alerta-tela-python.py
Created October 2, 2023 19:27
alerta-tela-python
import tkinter as tk
from tkinter import messagebox
# Cria uma janela tkinter (mas não a exibe)
janela = tk.Tk()
janela.withdraw() # Esconde a janela principal
# Mostra o alerta diretamente
messagebox.showinfo("Alerta", "Este é um alerta na tela!")
@matefs
matefs / porta-aberta-fechada-python.py
Created September 29, 2023 23:57
porta-aberta-fechada-python
#!/usr/bin/python
import socket
ip = "192.168.0.1"
porta = 80 # Se for porta 81 vai constar fechada.
meusocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
res = meusocket.connect_ex((ip, porta))
if (res == 0 ):
@matefs
matefs / atribuir valores aleatorios para o json.js
Created September 26, 2023 13:16
atribuir valores aleatorios para o json
function atribuirValoresAleatorios(json) {
// Converte a string JSON de volta para um objeto
const objeto = JSON.parse(json);
// Percorre todos os atributos do objeto
for (const chave in objeto) {
// Gera um valor aleatório para o atributo
const valorAleatorio = Math.floor(Math.random() * 100);
// Atribui o valor aleatório ao atributo
@matefs
matefs / o-livro-ilustrado-dos-maus-argumentos-ali-almossa.txt
Created August 23, 2023 15:03
o livro ilustrado dos maus argumentos ali almossa
ELOGIOS A
O livro ilustrado dos maus argumentos
“Eu amei este livro. É um compêndio infalível de falhas.” — ALICE ROBERTS, Ph.D., anatomista,
apresentadora do programa da BBC The Incredible Human Journey
“Maus argumentos, ótimas ilustrações… Maravilhoso.” — CORY DOCTOROW, do BoingBoing.net