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 fetch from 'node-fetch'; | |
/** | |
* Youtube Resolver Parameters | |
* @interface YoutubeResolverParams | |
* @property {string} url - Youtube URL (https://www.youtube.com/watch?v=VIDEO_ID) | |
* @property {string} videoId - Youtube Video ID | |
*/ | |
interface YoutubeResolverParams { | |
url?: string; |
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
// DDPClient.ts | |
import { EventEmitter } from 'events'; | |
/** | |
* Enum representing the different types of DDP messages. | |
* @property CONNECT - Client initiates a connection. | |
* @property CONNECTED - Server acknowledges a successful connection. | |
* @property FAILED - Server indicates a failed connection attempt. | |
* @property SUBSCRIBE - Client subscribes to a publication. |
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
unit ShellcodeCreator; | |
interface | |
uses | |
SysUtils, Windows, TypInfo, Classes, ZLib, System.Hash, System.Encryption; | |
/// <summary> | |
/// Shellcode creator for dynamically generating shellcode for function calls. | |
/// Supports x86, x64, and ARM architectures with parameter and return type handling. |
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
unit SysCallExecutor; | |
interface | |
uses | |
Windows, SysUtils; | |
type | |
TSysCallExecutor = class | |
private |
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
/** | |
* This function is used to load the native .node module. Since webpack replaces the native require function, | |
* we need to get the original require function from the global scope. | |
* | |
* Found this code here: https://github.com/prebuild/node-gyp-build/blob/master/node-gyp-build.js | |
*/ | |
// @ts-ignore | |
const runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require | |
const nativeModule = runtimeRequire('./path/to/module.node'); |
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
/** | |
* Get the type of an image. | |
* @param image The image as a buffer. | |
* @returns The type of the image. | |
*/ | |
export function getImageType(image: Buffer): Promise<{ mimeType: string, extension: string }> { | |
return new Promise((resolve, reject) => { | |
if (image[0] === 0xFF && image[1] === 0xD8 && image[2] === 0xFF) { | |
resolve({ | |
mimeType: 'image/jpeg', |
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 { useState, useEffect, useCallback, useRef } from 'react'; | |
/** | |
* WebWorker status flags | |
* - idle: The worker is not running any task | |
* - working: The worker is running a task | |
*/ | |
type WebWorkerStatus = 'idle' | 'working'; | |
/** |
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 { randomBytes, createHmac, timingSafeEqual } from 'crypto'; | |
/** | |
* Charset for base32 encoding | |
* @see https://en.wikipedia.org/wiki/Base32 | |
* @see https://tools.ietf.org/html/rfc4648 | |
*/ | |
const base32Charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; | |
/** | |
* Number of digits in TOTP token |
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
type ResolvablePromise<Value = void> = { | |
promise: Promise<Value>; | |
resolve: (value: Value | PromiseLike<Value>) => void; | |
reject: (reason?: any) => void; | |
}; | |
export function makeResolvablePromise<Value = void>(): ResolvablePromise<Value> { | |
let resolveFunction: (value: Value | PromiseLike<Value>) => void; | |
let rejectFunction: (reason?: any) => void; |
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
// BLEServer.cpp | |
// | |
// Copyright (C) 2024, Ernst Reidinga | |
// Copyright (C) 2017, Uri Shaked | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
#include <Windows.Foundation.h> | |
#include <Windows.Devices.Bluetooth.h> |
NewerOlder