Skip to content

Instantly share code, notes, and snippets.

View Fabricio-191's full-sized avatar

Fabricio Rubio Gaston Fabricio-191

  • San Juan, Argentina
View GitHub Profile
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt
// https://github.com/discordjs/discord.js/blob/393ded4ea14e73b2bb42226f57896130329f88ca/packages/discord.js/src/util/BitField.js#L8
import { inspect } from 'util';
function createBitField<T extends string>(FIELDS: T[], defaultValue = 0n) {
const masks = FIELDS.reduce((acc, field, i) => {
import whisper
from moviepy.editor import VideoFileClip # pip install moviepy==1.0.3
import os
import threading
import pptxtopdf
from functools import partial
import torch
torch.cuda.init()
mainFolder = os.path.dirname(os.path.abspath(__file__))
@Fabricio-191
Fabricio-191 / system.js
Created October 4, 2025 22:55
Random system utils, CPU usage (in the whole computer and by the process), memory usage (also in the whole computer and by the process), console colors
const OS = require('os');
const ALL_CPUS = OS.cpus();
const MAX_MEMORY = OS.totalmem();
module.exports = {
CPUs: ALL_CPUS.reduce((acc, cpu) => {
const repeated = acc.find(c => c.model === cpu.model);
if(repeated){
repeated.cores++;
}else acc.push({
@Fabricio-191
Fabricio-191 / entities.js
Created October 4, 2025 22:52
HTML entities decoder
const entities = require('./entities.json');
const entitiesRegex = RegExp(Object.keys(entities).join('|'), 'g');
function decodeEntities(str){
const matches = str.match(entitiesRegex);
if(!matches) return str;
return matches.reduce((acc, match) => acc.replace(match, entities[match]), str);
}
@Fabricio-191
Fabricio-191 / R6Sscript.ps1
Last active October 4, 2025 22:50
Rainbow six affinity patch for bad CPU usage. Can be used with any process
$intervalInMinutes = 5
$Mask = [Int] ([Math]::Pow(2, $env:NUMBER_OF_PROCESSORS) - 1)
while ($true) {
# wait for RainbowSix to open
$Process = Get-Process RainbowSix -ErrorAction SilentlyContinue
while ($Process -eq $null) {
Start-Sleep -Minutes $intervalInMinutes
$Process = Get-Process RainbowSix -ErrorAction SilentlyContinue
}
@Fabricio-191
Fabricio-191 / widgetToImage.dart
Created October 4, 2025 22:41
A function to convert a flutter Widget to a Image (by default png), it basically renders it offscreen and then takes a screenshot of it.
Future<Uint8List> renderWidgetToImage({
required final BuildContext context,
required final Widget widget,
final double pixelRatio = 3.0,
final ImageByteFormat format = ImageByteFormat.png,
}) async {
// Create a GlobalKey to identify the widget's render boundary
final GlobalKey boundaryKey = GlobalKey();
// Create an OverlayEntry to insert the widget off-screen
const { Suite } = require('benchmark');
function createBench(name = ''){
return new Suite(name)
.on('start', () => {
if(name) console.log(name);
})
.on('error', (event) => {
throw event.target.error;
})