Skip to content

Instantly share code, notes, and snippets.

View Withoutbytes's full-sized avatar

Jonathan Withoutbytes

View GitHub Profile
(function () {
try {
const merchantId = "manhattan_br"; // Substitua pelo seu Merchant ID
const fingerPrint = new Date().getTime();
const sessionId = `${merchantId}${fingerPrint}`; // Gera um sessionId único
// Insere o script de fingerprinting dinâmico
const script = document.createElement("script");
script.type = "text/javascript";
script.src = `https://h.online-metrix.net/fp/tags.js?org_id=k8vif92e&session_id=${sessionId}`;
(function () {
try {
const merchantId = "manhattan_br"; // Substitua pelo seu Merchant ID
const fingerPrint = new Date().getTime();
const sessionId = `${merchantId}${fingerPrint}`; // Gera um sessionId único
// Insere o script de fingerprinting dinâmico
const script = document.createElement("script");
script.type = "text/javascript";
script.src = `https://h.online-metrix.net/fp/tags.js?org_id=k8vif92e&session_id=${sessionId}`;
@Withoutbytes
Withoutbytes / classNames.ts
Created November 27, 2021 11:08
classNames for react / next.js, this is use full for control css with your javascript/typescript
export function classNames(...classes: (string | any | false)[]) {
return classes.filter(Boolean).join(" ");
}
@Withoutbytes
Withoutbytes / useSocketIO.ts
Created November 27, 2021 11:07
Use socket.io-client for react / next.js with lastMessage system and emit with auto cleanup.
import { useEffect, useState } from "react";
import { io, ManagerOptions, Socket, SocketOptions } from "socket.io-client";
export const useSocketIO = (
uri?: string | Partial<ManagerOptions & SocketOptions>,
opts?: Partial<ManagerOptions & SocketOptions>
): [Socket] => {
const [activeSocket, setActiveSocket] = useState<Socket>(null);
useEffect(() => {
@Withoutbytes
Withoutbytes / web-servers.md
Created August 9, 2021 19:27 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Withoutbytes
Withoutbytes / hyper-v vmware
Created July 24, 2021 09:03
hyper-v vmware switch
I use the following command to be able to use either vmware workstation pro 15 or hyper-v on the same pc. One at a time.
If I want to use vmware workstation pro 15 I enter:
Bcdedit /set hypervisorlaunchtype off
Then restart
If I want to use hyper-v I enter:
@Withoutbytes
Withoutbytes / main.cpp
Created February 20, 2020 02:53 — forked from micjabbour/main.cpp
C++ WinAPI - get first physical drive serial number
#include <windows.h>
#include <memory>
#include <string>
//returns the serial number of the first physical drive in a std::string or an empty std::string in case of failure
//based on http://codexpert.ro/blog/2013/10/26/get-physical-drive-serial-number-part-1/
std::string getFirstHddSerialNumber() {
//get a handle to the first physical drive
HANDLE h = CreateFileW(L"\\\\.\\PhysicalDrive0", 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if(h == INVALID_HANDLE_VALUE) return {};