Skip to content

Instantly share code, notes, and snippets.

View ViniciusFXavier's full-sized avatar
👨‍💻
Coding...

Vinícius Francisco Xavier ViniciusFXavier

👨‍💻
Coding...
View GitHub Profile
@ViniciusFXavier
ViniciusFXavier / misterio.js
Created March 29, 2025 00:06
Magic With javascript, all in one variable
function callableTarget() {}
const misterio = new Proxy(
callableTarget,
{
apply(target, thisArg, args) {
if (args.length) {
return `Porque me chamou com esses argumentos: ${args}`;
}
return ['a', 'b'];
@ViniciusFXavier
ViniciusFXavier / script.jsonp
Last active January 16, 2025 15:54
JSONB test
callback({
"status": "success",
"message": "JSONP callback executed successfully",
"data": {
"id": 123,
"value": "Hello, world!"
}
});
@ViniciusFXavier
ViniciusFXavier / index.js
Created June 23, 2024 23:19
[NODE-REALOAD] Update node dependencies without close running server
// On this example i can add or remove routes and no need to stop ou restart the server
const http = require('http');
// nothing before will be updated if there are changes
require('./node-reload') // Does not change the caller file, requiring on the start is best
// any require from here will be updated if there are changes
// Criando o servidor HTTP
const server = http.createServer((req, res) => {
@ViniciusFXavier
ViniciusFXavier / .wslconfig
Last active July 5, 2024 14:43
Install and configure WSL
# Doc: https://learn.microsoft.com/en-us/windows/wsl/wsl-config
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# Limits VM memory to use no more than 10 GB, this can be set as whole numbers using GB or MB
memory=10GB
# Sets the VM to use two virtual processors
processors=2
@ViniciusFXavier
ViniciusFXavier / gemini-web-api.js
Created May 16, 2024 23:51
Gemini Google Ai - Web API
import { GoogleGenerativeAI } from "@google/generative-ai";
const API_KEY = "KKKKKKEEEEEEEEEYYYYYYYYYY";
const genAI = new GoogleGenerativeAI(API_KEY);
const generationConfig = {
temperature: 0.9,
};
// Modelo 'gemini-pro' para chat
const model = genAI.getGenerativeModel({
@ViniciusFXavier
ViniciusFXavier / flow-field.html
Last active June 8, 2023 05:59
Gas Spread Simulation
<!DOCTYPE html>
<html>
<head>
<title>Flow Field Simulation</title>
<style>
canvas {
border: 1px solid black;
}
</style>
@ViniciusFXavier
ViniciusFXavier / increase-process-priority.txt
Created February 23, 2023 07:32
Increase the priority of a win10 application
1. Press WINDOWS KEY + R
2. Type in "RegEdit"
3.Navigate on to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
Create a new Key:
"yourgame.exe"
Create another Key:
interface INode {
value: number;
right?: Node;
left?: Node;
}
class Node implements INode {
value: number;
right?: Node;
left?: Node;
@ViniciusFXavier
ViniciusFXavier / Dockerfile
Last active May 19, 2021 12:56
Clone private git repo with dockerfile
FROM ubuntu
MAINTAINER Vinícius Francisco Xavier "[email protected]"
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git
@ViniciusFXavier
ViniciusFXavier / example.js
Last active April 12, 2021 16:54
Detect on change
const object = {
foo: false,
a: {
b: [
{
c: false
}
]
}
};