Skip to content

Instantly share code, notes, and snippets.

@WillianJws
WillianJws / index.html
Created April 5, 2025 21:17
README Primeiro: Modo de instalar no VSCode criar uma pasta criar cada repositor, Index.html, style.css, script.js Copiar e colar o código html no repositor criado index.html Copiar e colar o código CSS no repositor criado style.css Copiar e colar o código JS no repositor criado script.js Segundo: abrir o site aperte f5 em seu vscode, onde irá a…
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Conversão de Moedas</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
@Pulimet
Pulimet / AdbCommands
Last active April 5, 2025 21:10
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
-module(midi).
-export([parse/1, parse_file/1]).
-define(BEINT, big-unsigned-integer-unit).
-define(BEBIT, 1/?BEINT:1).
-define(BEINT7, 1/?BEINT:7).
-define(BEINT16, 1/?BEINT:16).
-define(BEINT32, 1/?BEINT:32).
-define(MIDI_HEADER, 16#4d546864:?BEINT32).
@tlhenvironment
tlhenvironment / mqtt_rust_tls.rs
Last active April 5, 2025 21:07
Rust MQTT TLS on ESP32
//use rust-mqtt = { git = "https://github.com/obabec/rust-mqtt.git", rev = "b5ed04efc694c5a0e4f6925b7f90ebaac9f0504f", default-features = false, features = ["log", "tls"] }
//tcp
let mqtt_broker_addr = stack.dns_query(broker_str, embassy_net::dns::DnsQueryType::A).await.unwrap();
let mqtt_endpoint = IpEndpoint::new(endpoint, 8883);
let mut socket = embassy_net::tcp::TcpSocket::new(stack, &mut rx_buffer, &mut tx_buffer);
socket.connect(mqtt_endpoint).await.unwrap();
//tls
let config: TlsConfig<'_> = TlsConfig::new().with_server_name(&broker_str).enable_rsa_signatures();
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 5, 2025 21:07
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@fatbobman
fatbobman / noteExtension.swift
Created March 16, 2024 13:40
ModelExtensionDemo
import Foundation
import SwiftData
extension Note {
/// 根据给定的筛选条件生成相应的谓词,用于筛选笔记。
public static func predicateFor(_ filter: NotePredicate) -> Predicate<Note>? {
var result: Predicate<Note>?
switch filter {
case let .filterRootNoteByName(name):
result = #Predicate<Note> { $0.name == name && $0.parent == nil }
@NorkzYT
NorkzYT / proxmox-lxc-cifs-share.sh
Last active April 5, 2025 21:02
Proxmox CIFS Share Mount Wizard Script
#!/bin/bash
# This script is designed to assist in mounting CIFS/SMB shares to a Proxmox LXC container.
# It automates the process of creating a mount point on the Proxmox VE (PVE) host, adding the
# CIFS share to the /etc/fstab for persistent mounts, and configuring the LXC container to
# recognize the share. This script is intended for use on a Proxmox Virtual Environment and
# requires an LXC container to be specified that will access the mounted share.
#
# Prerequisites:
# - Proxmox Virtual Environment setup.
@ma7555
ma7555 / sstp_server.md
Last active April 5, 2025 20:58
SSTP VPN Server with Docker on Ubuntu VPS

On the VPS:

  • Create a 10 year certificate. The "Common Name" (CN) must be the static IP of the instance.
    openssl req  -nodes -new -x509 -keyout key.pem -out cert.pem -days 3650
  • Run the SoftEther docker with either of the following:
    1. A Single User, SSTP only. Not updated recently (7 years ago at the time of creating the gist)
    sudo docker run -d --cap-add NET_ADMIN -e SSTP_ENABLED=1 -e USERNAME=YOUR_VPN_USERNAME -e PASSWORD=YOU_VPN_PASS -e SERVER_PWD=YOUR_SERVER_PASS -e CERT="$(cat cert.pem)" -e KEY="$(cat key.pem)" -p 443:443/tcp fernandezcuesta/softethervpn
@gm3197
gm3197 / vas.md
Last active April 5, 2025 20:53
Reverse Engineered Value Added Services Protocol Specification

Reverse Engineered VAS Protocol Specification

Research by Grayson Martin
Last Updated 7/8/23

Introduction

Value Added Services (VAS) is the protocol used by NFC capable passes in Apple Wallet. Access to this protocol is heavily restricted on both the device end (a special certificate issued by Apple is required to create these passes) and the reader end (NDA enforced confidentiality). As such, a desire arose to better understand the protocol in order to explore additional use cases and examine its cryptographic integrity. There are gaps in understanding in certain parts of this protocol, however this document contains the minimum necessary understanding to automatically select, read data from, and decrypt a pass.

Importantly, this specification does not enable a malicious actor to read the data from a pass for which they do not have both the reader's private key, and the pass type identifier. Imp

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com