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
// 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) => { |
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 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__)) |
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 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({ |
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 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); | |
} |
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
$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 | |
} |
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
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 |
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 { Suite } = require('benchmark'); | |
function createBench(name = ''){ | |
return new Suite(name) | |
.on('start', () => { | |
if(name) console.log(name); | |
}) | |
.on('error', (event) => { | |
throw event.target.error; | |
}) |