const person = {
name: 'John',
age: 30,
city: 'New York'
};
for (let key in person) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 ): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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!") |
document.addEventListener('keydown', function(event) {
if (event.key === 'F2') {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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__": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en" > | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>CodePen - React Material UI Template</title> | |
| </head> | |
| <body> |
OlderNewer