Skip to content

Instantly share code, notes, and snippets.

View Frontesque's full-sized avatar
⌨️
Making Software

Kenny Frontesque

⌨️
Making Software
View GitHub Profile
@Frontesque
Frontesque / rgb2tuya.js
Created May 17, 2023 21:58
rgb2tuya - Convert RGB to the Tuya-compatible color string
function rgb2hsv(r, g, b) {
r /= 255, g /= 255, b /= 255;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, v = max;
var d = max - min;
s = max == 0 ? 0 : d / max;
if (max == min) {
h = 0; // achromatic
} else {
switch (max) {
@Frontesque
Frontesque / YoutubeScraper.js
Created November 24, 2021 20:20
Scrape the video IDs off of the youtube homepage with one click
//--- Config ---//
const config = {
videoIdFinderStart: `"videoId":"`,
videoIdFinderEnd: '"',
timesToCheck: 180,
videoIdLength: 11,
};
//--- Module Imports ---//
const axios = require('axios');
@Frontesque
Frontesque / Common_Words.txt
Created July 9, 2021 20:36
A list of 173k common words
This file has been truncated, but you can view the full file.
aa
aah
aahed
aahing
aahs
aal
aalii
aaliis
aals
aardvark
@Frontesque
Frontesque / SlashCommandManager.js
Created January 22, 2021 18:24
Discord.js V12 slash commands manager
module.exports = class SlashCommandManager {
constructor(client) {
this.client = client;
};
async createGlobalCommand(data = {}) {
return this.client.api.applications(this.client.user.id).commands.post({
data: data
});