#development

1 messages Β· Page 231 of 1

frosty gale
#

you have sequential arrays which are full of elements

#

and arrays which may have holes in between of elements

frosty gale
frosty gale
quartz kindle
#

theres like 8 different types

#

6 actually

sharp geyser
#

hello tim

quartz kindle
#

general kenobi

sharp geyser
#

do you know how VOD (Video On Demand) works?

#

Its different from live streaming

quartz kindle
#

i mean

sharp geyser
#

As you upload the files, and then encode them, and then stream them out to people through HLS/DASH

quartz kindle
#

vod is like youtube video

sharp geyser
#

yuh

#

Im just trying to figure out if I can do this myself or nah

#

πŸ’€

quartz kindle
#

stream is the same thing, but the file is not stored on disk, just buffered in memory

#

or likely both

#

on livestream you have an input, the recording, then as the input comes in, you both save it to disk, and redirect it to some network output

sharp geyser
#

If I can do this myself and not use a service like bunny.net then I 100% will, it'd likely be cheaper

quartz kindle
#

livestream is uploaded to cdn in real time, then viewers connect to the cdn to stream it

sharp geyser
#

I also have to encrypt/decrypt the files myself also πŸ˜”

quartz kindle
#

probably yeah, but video cdn is like a separate service no?

#

becaude video is expensive

sharp geyser
#

yea my only problem is

#

I dont want to pay for their storage if I can avoid it

#

I'd rather pay 4$ / tb rather than 10-20

#

or even 30

#

I get that it's replicating the files too those locations and making it faster for the cdn but still

#

up to 30$ a month per tb

quartz kindle
#

livestream to youtube/vimeo upload

#

free cdn

#

:^)

sharp geyser
#

I can't do that

#

😭

#

I mean realisitcally its a pay as you go system, so you only pay for what you use so it wont be that much to start out with

#

but if it gets that high ima be fucked if im not bringing in revenue

quartz kindle
#

ye video is expensive

#

itis a lot of data

sharp geyser
#

I guess ima have to suck it up

#

bunny is the least expensive option

#

5$ /tb of bandwidth isn't the worst

#

The only sucky part is the storage but its whatever, hopefully it will bring in some revenue if I code this shit properly

dawn socket
#

like buttons a span svg etc

sharp geyser
#

is DRM support mandatory?

#

If I enable DRM, yes it stops video downloads

#

but it also limits how I can play said videos

#

There is only selected number of players (all of them look absolutely terrible) that support playing DRM protected content

#

and the ones that exist only work on x browsers, and sometimes doesn't work on x devices

#

I notice even youtube doesn't protect all their videos via DRM

#

only the paid ones

frosty gale
# quartz kindle

arent all numbers in js doubles? why is there one for normal elements and one for doubles

#

i would guess the other one is for arrays which contain things like objects

frosty gale
#

i wouldnt use it unless theres a good reason to

sharp geyser
#

Gotcha

#

I was looking at bunny.net's DRM and I was like erm no thanks

#

their enterprise DRM is like expensive asf too

#

Each time someone plays a video it charges you 0.005 a license

frosty gale
#

some DRM also depends on the hardware and OS and will refuse to play if you dont have satisfactory hardware like HDCP which requires the gpu and monitor and drivers to support them

sharp geyser
#

Bruh

#

Thats kinda wack

frosty gale
#

louis rossman did a whole video on netflix doing it

#

they dont allow you to stream HD on unsupported hardware

sharp geyser
#

That's bogus

#

Alright note to self no drm

#

That saves me another headache

quartz kindle
#

basically 1byte ints

#

so you have array of int/char, array of double and array of pointer

#

this is on the v8 side btw, on the js side all numbers are doubles yes

rigid maple
#

I use svelte and tailwind, but tailwind does not work when I try to design a homepage.

#

tailwind's output.css is in the head section

#

It works when I give it as a style instead of the tailwind class.

surreal sage
#

rate the jsdoc

neon leaf
#

wow

civic scroll
rigid maple
digital swan
#

are you importing the css on the correct layout?

rigid maple
#

yes i imported css from app.html

sharp geyser
#

excuse me what
Error: Io(Os { code: 54, kind: ConnectionReset, message: "Connection reset by peer" })

lyric mountain
#

the other side dropped connection

sharp geyser
#

... I am the client

#

Like I am starting the webserver

lyric mountain
#

the other side

sharp geyser
#

I am the other side

#

πŸ’€

#

I am simply running an api that literally does nothing rn but return hello world at /

lyric mountain
#

no, like, if u receive that on server it's cuz client dropped, same for the other way around

sharp geyser
#

right

#

but here's the thing

#

How is it dropping if its happening when I start the webserver

lyric mountain
#

does it appear when u access the url or when u literally start?

sharp geyser
#

quite literally when I start it

#

I already authorized it on my macbook

#

so that can't be it

lyric mountain
#

hm, are u using any service?

#

or api, database, whatever

sharp geyser
#

Oh wait

#

indeed I am

#

πŸ’€

lyric mountain
#

then that's where the issue lies

sharp geyser
#

Forgot that I was

#

ngl

#

postgres://asdasd:asdasdads@localhost:5432/vidcord does this look correct?

lyric mountain
#

is that supposed to be a jdbc url?

#

if so, it's incorrect

sharp geyser
#

nah

#

doesn't have to be jdbc

lyric mountain
#

ok but does it use the jdbc standard?

sharp geyser
#

If it does it doesn't ask for it

lyric mountain
#

the standard database url is driver://url:port/database

sharp geyser
#

🦐

#

I got it working

#

When I opened the ssh tunnel I used the wrong ip

#

I put 0.1 instead of 1.1 as the last 2

lyric mountain
#

skill issue

sharp geyser
#

Also

#

I have to url encode my redirect uris for discord oauth2 right

lyric mountain
#

well, not specifically for oauth2, u have to do it to have a valid url to begin with mmLol

#

non encoded urls aren't valid at all

surreal sage
#

is *.* a valid wildcard in dns

#

or does * already do that

#

asking cuz cloudflare doesnt supply ssl for anything but first level sub domains

#

nvm not possible

lyric mountain
#

never saw a url that has 2 levels of sub domain

quartz kindle
surreal sage
#

heh

quartz kindle
#

:^)

surreal sage
#

does it happen if u have too many jsx elements

#

or

quartz kindle
surreal sage
#

im already on the latest

quartz kindle
#

some people say they fixed by rolling back to v4

#

lmao

surreal sage
#

fuck that

#

was just trying out threejs but ig not

surreal sage
#

its alr i deleted my code anyways

quartz kindle
#

nooo if you do that then ts wins

#

ts must not win

surreal sage
#

ts won

quartz kindle
#

noooo

#

js my love, it doesnt matter if ts won, js will always be the winner in my heart

#

:^)

lyric mountain
dawn socket
#

how long discription have character limit?

#

i'm unable to save it

civic scroll
dawn socket
dawn socket
civic scroll
#

what do you wish to aquire via topgg elements

lyric mountain
#

worth to note, it's useless to use any of top.gg classnames

#

except for a few that are fixed, they change on every page load

dawn socket
#

where user can interact with it

#

can i execute my bot command in the description

lyric mountain
#

you can't use js in long desc

civic scroll
lyric mountain
#

it doesn't, only html + css

civic scroll
#

but even so that is not recommended

#

i don't see the point of having interactive bot preview

#

because if anything they can try out in private servers, or your support server

#

also hi kuu

lyric mountain
#

hi sa-yun

#

I did add an interactive preview, but just cuz there was no way of showcasing 20 cards without becoming a mess

#

it's just a roulette tho

civic scroll
#

i meant in context of topgg desc

#

that would just hog perf so much

lyric mountain
civic scroll
#

o

#

yugioh style

dawn socket
#

we can use iframe right?

lyric mountain
#

yep

sharp geyser
#

Whats the base url for discord's api

#

I swear I can never remember it

#

😭

#

is it https://discord.com/api/v10/?

lyric mountain
#

I think so

sharp geyser
#

I can never find it on the docs

quartz kindle
sharp geyser
#

Ah

#

ty

quartz kindle
#

also why is v6 still default

#

wtf

lament rock
#

It's still supported and what the majority of bots were on

#

There might be some lobbying from larger bots to keep it alive

#

I don't think they'd have extended its life time this much if that wasn't the case

quartz kindle
#

i mean, supported sure, but default is weird, especially how pushy discord was with v9 an v10 things

#

i guess its for compatibility with old libs who dont explicitly set a version in the url lol

lament rock
#

Maybe. It's weird

#

A lot of old bots will die, that's for sure

#

I wonder what kind of message bots will receive when their gateway connection gets terminated for good looks like

quartz kindle
frosty gale
#

cant wait to have to update discord.js for a discord bot i have running to track some data that i never touch

#

and then have to deal with djs breaking changes as a result

#

"just dont update djs" tell that to the discord gateway

quartz kindle
#

djs is like apple, planned obsolete

#

force people into getting the new one every year

#

to keep the project running

#

lmao

past field
#

is there a way to prevent the bot from crashing when someone tries to use it without the correct perms/view channel access? when i get β€œmissing access” error it shuts the bot down

past field
quartz kindle
sharp geyser
#

hey tim

#

have you ever heard of discord's oauth2 token endpoint returning an html page

#

the status code is 200 so I assume it was successful

#

but instead of giving me the access token and what not it returns an html page

quartz kindle
#

its a cloudflare page im guessing

#

i've seen that happen before

#

returns some rate limit information or something, but in an html page lol

sharp geyser
#

wait a sec

#

did I just find a vulnerability

#

why does it give me their stripe keys

#

πŸ‘€

quartz kindle
#

its probably just stuff related to your session

sharp geyser
#

but I don't have anything related to stripe?

quartz kindle
#

well, a lot of services create sessions of everything, including visitors

sharp geyser
#

but do thye put it in in window.Global_Env?

sharp geyser
#
Response: "{\"message\": \"Invalid Form Body\", \"code\": 50035, \"errors\": {\"redirect_uri\": {\"_errors\": [{\"code\": \"URL_TYPE_INVALID_URL\", \"message\": \"Not a well formed URL.\"}]}}}"
#

Uhm but its the same exact url I used when authorizing

quartz kindle
#

why do people give you formatted json responses

#

just have the user format the json themselves

#

its not meant to be transmitted in its formatted form lmao

sharp geyser
#

wut

#

What are you talkin bout

#

Thats a console log buddy

#

πŸ‘€

quartz kindle
#

ah lol

#

nvm then xD

sharp geyser
#

lol

#

still tho

#

wtf is discord cooking

quartz kindle
#

bread

sharp geyser
#

I gave them the same exact redirect uri as I did when authorizing

#

so how is it not well formed

#

http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fauth%2Fdiscord%2Fcallback

#

this is how it looks

#

Is this not correct?!?!?!

#

wait a sec

#

do I not need to url form encode the urls?

#

I guess not

#

noted

frosty gale
#

im writing a feature where you can search for users by username and it gives you the top x users depending on the likeness to the username you typed in

#

its an sql database and i am not sure if there is any way i can really optimise this for a large amount of users

#

was thinking of doing the levenshtein distance but that definitely defeats any hope of optimisation so maybe ill check by first letters in the usernames

quartz kindle
#

if usernames are indexed, get all usernames that match string in any position, then order result by levenshtein

#

but if you want something more fuzzy, then its more complicated

frosty gale
#

i dont think theres really a way to avoid a full table scan in this case

#

assuming there is a lot of users

quartz kindle
#

depends on your index

#

i think normal indexes support LIKE query with prefix (basically startswith)

#

for LIKE queries with both prefix and postfix you probably need a different index, like trigram

frosty gale
#

ah i didnt know you could still do an indexed search with anything other than exact matches

#

i think in this case for best optimisation ill do searches by prefixes

quartz kindle
frosty gale
#

for a lot of indexes b-trees are used

#

the nodes for each string are ordered by their character order

#

so it can traverse down the tree if you search by prefix of suffix easily

#

so you get an o(log(n)) search since each search of prefix/suffix halves the possible amount of combiantions

quartz kindle
#

ye

frosty gale
#

im not sure if i can insert a template inside of a like statement but its worth a try

#

you cannot

#

you have to concatenate them

eternal osprey
#

I am trying to remove really small outliers using the IQR but found that it sets the threshold to like a big minus. I know my calculation is correct though...

#

Is it just how iqr behaves? Is it skewed towards removing small value outliers instead of big value ones?

quartz kindle
#
"... LIKE ?").all(`${username}%`)
sharp geyser
#

when defining a varchar(x), x is the amount of bytes right, not like character length?

#

so I can do varchar(16) for a 16 byte string of text (GUID)

quartz kindle
#

its db dependent

#

lmao

sharp geyser
#

I put 36 just in case

quartz kindle
sharp geyser
#

since GUID is typically 36 characters long

#

idk if postgres does it

#

but if so oh well now there is a 36 byte roof

#

πŸ’€

quartz kindle
#

if you use varchar it will use strings anyways

#

and count the bytes in the string

sharp geyser
#

I put 36 cuz honestly doesn't really matter

#

its reasonable enough

#

it wont cause performance issues

quartz kindle
#

if you want to save only 16 bytes then you need either the UUID type or binary type

sharp geyser
#

πŸ˜”

#

I really dont care at this point

quartz kindle
#

understandable

sharp geyser
#

but wont the uuid type conflict when inserting a guid?

quartz kindle
#

idk

sharp geyser
#

ah ok

#

so it is characters

#

looking at the docs for pg

#

varchar(n) where n is the number of characters (not bytes)

lyric mountain
#

I mean, it's kinda the same thing

#

As chars and bytes have the same size

#

Varchar is 2 + n bytes

dawn socket
#

i'n unable to delete announcement

civic scroll
#

check if you have permission to delete it

dawn socket
#

how can i fix this?

civic scroll
#

oh, the website

#

just hit Esc

dawn socket
dawn socket
#

how can i make it invisible?

#

i'm editing my page

neon flicker
#
TypeError: client.commands.get is not a function

Is it related to my Discord.js version?

#

Beacuse in the updated documents, it seems to be a valid function

solemn latch
past field
#

anyone able to look at this and tell me why it's showing this timestamp?

#
const { SlashCommandBuilder } = require('@discordjs/builders');
const db = require('../db');

const DAILY_COINS = 30; // Number of daily coins a player can claim
const TWELVE_HOURS = 12 * 60 * 60; // Time period in seconds (12 hours)

module.exports = {
    data: new SlashCommandBuilder()
        .setName('daily')
        .setDescription('Claim your daily Click War Coins.'),
    async execute(interaction) {
        const playerId = interaction.user.id; // Fetching the player's Discord ID
        const now = Math.floor(Date.now() / 1000); // Current time in seconds

        try {
            // Fetching player stats from the database
            const stmt = db.prepare('SELECT click_war_coins, last_daily FROM players WHERE id = ?');
            const playerStats = stmt.get(playerId);

            if (!playerStats) {
                // If the player is not in the database, add them
                const insertStmt = db.prepare('INSERT INTO players (id, click_war_coins, last_daily) VALUES (?, ?, ?)');
                insertStmt.run(playerId, DAILY_COINS, now);

                const nextClaimTime = now + TWELVE_HOURS;
                await interaction.reply({ content: `You have claimed your daily ${DAILY_COINS} Click War Coins! Your next claim is available <t:${nextClaimTime}:R> at <t:${nextClaimTime}:t>.`, ephemeral: true });
            } else {
                const { click_war_coins, last_daily } = playerStats;

                if (now - last_daily < TWELVE_HOURS) {
                    // If the player has already claimed their daily coins within the last 12 hours
                    const nextClaimTime = last_daily + TWELVE_HOURS;
                    await interaction.reply({ content: `You can claim your daily Click War Coins <t:${nextClaimTime}:R>. Your next claim is available at <t:${nextClaimTime}:t>.`, ephemeral: true });
                } else {
                    // If the player can claim their daily coins
                    const updateStmt = db.prepare('UPDATE players SET click_war_coins = click_war_coins + ?, last_daily = ? WHERE id = ?');
                    updateStmt.run(DAILY_COINS, now, playerId);

                    const nextClaimTime = now + TWELVE_HOURS;
                    await interaction.reply({ content: `You have claimed your daily ${DAILY_COINS} Click War Coins! Your next claim is available <t:${nextClaimTime}:R> at <t:${nextClaimTime}:t>.`, ephemeral: true });
                }
            }
        } catch (error) {
            // Error handling for database operations
            console.error('Database operation failed:', error);
            await interaction.reply({ content: 'An error occurred while processing your request. Please try again later.', ephemeral: true });
        }
    }
};
neon flicker
#

Sure, send the code please

#

What exactly is the issue? Like what does the message that it sends look like?

past field
neon flicker
#

Because Discord's built-in timestamping does not use milliseconds AFAIK, so you should try dividing it by 1000 before showing it up

#

I might be wrong as well, sorry if I am

past field
#

it does already

#
const now = Math.floor(Date.now() / 1000);
neon flicker
#

Okay, let me check the code again

past field
#

maybe it's the database

neon flicker
#

I don't really have much experience with SQL so it might be, please try printing what it returns so we may see the problem

past field
#

i’ve just added some debugging to see what it’s calculating

#

it won't let me post it

#

ohhhh i see what it is

deft wolf
#

Automod probably detected it as a phone number

past field
#

last_daily is stored in milliseconds, not seconds

#

ok it's fixed

solemn latch
#

Honestly, I dont know why we have that one, I've not seen a phone number posted ever. Or I dont remember that

past field
deft wolf
#

Good job

real rose
#

and dont have any invite links or pings in the messages

#

iirc

solemn latch
#

ah

frosty gale
#

@lyric mountain mr nginx i have routes like /api/users/:userid/delete, can you match routes like /api/users/*/delete or is it more complicated

sharp geyser
#

why are you doing this at nginx level?

#

Is there something specific you want mapped at those routes?

lyric mountain
#

u probably can, but shouldn't

surreal sage
#

docker try not to download images at 0.1 mb/s level impossible

quartz kindle
frosty gale
#

but nginx no no wanna support modern url conventions

frosty gale
#

wonder if theres a module that adds support for this

sharp geyser
#

Why on the nginx level?

#

I mean without using regex idk what else you can do

#

any module will likely also use regex

frosty gale
#

i would think nginx would be able to handle things like this much more optimally than any server can

sharp geyser
#

why would you want that on proxy level though

frosty gale
#

fast

sharp geyser
#

That's something your app should handle no?

#

or even cloudflare

frosty gale
#

if i wanna rate limit someone for example

#

i can make nginx go bye bye on connection instantly

#

if the app handled that it would have to proxy it through and process the request again on its end

sharp geyser
#

Should I expire session cookies if I am using my own auth system?

#

or should I just remove the sessions when they log out

#

I feel like so long as they don't log out themselves I see no reason to log them out for them at a certain time

quartz kindle
#

personal preference pretty much

sharp geyser
#

icic

pearl trail
#

maybe just put 6 months or so

sharp geyser
#

eh

#

I wont bother

pearl trail
sharp geyser
#

If they dont logout themselves why expire them

#

if they are dumb enough to give out their session id cookie sucks to be them

#

πŸ’€

pearl trail
#

well if your data is very important, you should expire them

#

attackers steal cookies from websites to gain access to user's account

civic scroll
sharp geyser
#

Not my problem if someone allows their cookie to be stolen

pearl trail
#

then sure yeah

sharp geyser
#

I can expire them sure

#

but thats more headache for me

pearl trail
#

eh, well attackers don't ask users for permission to access their cookies or not

#

but whatever

sharp geyser
#

I mean...

#

They don't need permission when they just give it out

#

πŸ’€

#

"Here click this link and install it" "Ok sure"

#

"Use this public wifi without a vpn" "Ok sure"

pearl trail
#

@civic scroll can I handle db like insert on nextjs?

sharp geyser
#

If I tried to protect people from their stupidity I would spend more time on that then actual features

sharp geyser
#

You should not be making any direct db calls from nextjs

#

You should have an API you call to that handles that for you

civic scroll
#

which means you can setup api routes

sharp geyser
#

do people actually use that tho?

civic scroll
#

why not?

sharp geyser
#

Well, sure if its something small

#

but anything big I advise breaking it off

pearl trail
civic scroll
#

you have types usable by both frontend and backend

pearl trail
#

well in react you can disable that on build

sharp geyser
#

right, but thats only helpful if its a small api

#

anything big and complex is a bad idea to use that

civic scroll
#

you can break it out

sharp geyser
#

not to mention any big api should not be written in js

civic scroll
#

in fact iirc nextjs has a separated foldersfor api endpoints

sharp geyser
#

it does indeed

sharp geyser
#

yea sure nestjs is cool

#

and its fine for something small scale

pearl trail
# civic scroll yes

oki, last question, can I do anything on the nextjs server? like I can install any npm that runs on node

civic scroll
#

there is elysia
the creator is a cosplayer

sharp geyser
#

but there's a reason companies don't use js for enterprise level backend apis

pearl trail
#

maybe like canvas, jimp, sharp

sharp geyser
#

its not efficient

civic scroll
pearl trail
#

okokokok

civic scroll
#

in SSR and and ISR configurations, you code runs on the server

pearl trail
#

thanks

sharp geyser
#

πŸ’€

civic scroll
#

fuck.

sharp geyser
#

so not node

civic scroll
#

ima make elysia in node and then cosplay

sharp geyser
#

😭

civic scroll
#

comptetitorβ„’

sharp geyser
#

I stand by that js is terrible for enterprise level abckend apis

#

its not efficient and wont hold up to that amount of traffic

civic scroll
#

yes BUT

#

tbh no enterprise has only one person for backend

#

EXCEPT

#

THE USS ENTERPRISE πŸ¦…πŸ‡ΊπŸ‡ΈπŸš’

pearl trail
#

thanks misty, now I'm interested in using ruby on rails for rest api

sharp geyser
#

My only thing is, if its something small js can definitely do it

#

but if you are getting thousands or hundreds of thousands of people hitting your backend api it becomes a problem

#

js isn't meant to handle that, and to make it even get close to being able to handle something like that is more work than its worth

pearl trail
#

looks fast πŸš€

radiant kraken
pearl trail
radiant kraken
warm surge
#
  if (n < 1e3) return n;
  if (n >= 1e3 && n < 1e6) return +(n / 1e3).toFixed(1) + "K";
  if (n >= 1e6 && n < 1e9) return +(n / 1e6).toFixed(1) + "M";
  if (n >= 1e9 && n < 1e12) return +(n / 1e9).toFixed(1) + "B";
  if (n >= 1e12) return +(n / 1e12).toFixed(1) + "T";
};
sharp geyser
#

what even is this

warm surge
sharp geyser
#

Yea

#

I understand that

#

but why

warm surge
#

its just suggestions for his rpc

rose warren
#

My rpc is how I want it to be mayaLaugh

sharp geyser
#

@pearl trail question

#
<html lang='en'>
      <body>
        <div className='flex flex-row'>
          <Drawer />
          <Navbar />
          {children}
        </div>
      </body>
    </html>
#

not an optimal result

#

the Hello all the way at the right is the {children}

pearl trail
#

where do you want to have the {children}

sharp geyser
#

I guess in the empty whitespace

#

Idk how to describe it

#

Ideally the content of each page should be surrounded by the navbar and drawer

pearl trail
#
<html lang='en'>
      <body>
        <div className='flex flex-row'>
          <Drawer />
+          <div className="w-full">
            <Navbar />
            {children}
+          </div>
        </div>
      </body>
</html>
#

hope the width works

sharp geyser
#

:o

#

why tf does that work

surreal sage
#

thought i had a hdd failure just now, just wasn't plugged in right..

pearl trail
#

before, you have

- drawer
- navbar
- hello

those 3 are in 1 flex-row, so you gotta do

- drawer
- div
  - navbar
  - hello

there are only 2 that will be "flexed", drawer and div with navbar and hello

sharp geyser
#

ah shit

#

I just realized that w-full is likely going to interfear with me resizing the drawer's width no?

#

oh no wait

#

its me doing w-screen inside navbar

pearl trail
#

yes

#

w-full is 100%

sharp geyser
#

yea but that wasn't what was stopping me

#

it was me doing w-screen inside navbar's main element

#

I 100% will need to change the color scheme at a certain point

#

but for now i cba

#

I just want the stuff there

#

I can fuck with the color scheme later

surreal sage
#

sudo give me purpose

neon leaf
#

alias fucking='sudo'
fucking apt update && fucking apt full-upgrade -y

sharp geyser
#

navbar only

#

the drawer looks UGLY

#

at least open 24/7

surreal sage
quartz kindle
sharp geyser
#

What kind of algorithm should I use to show the user most liked videos in two scenarios

  1. They are not subscribed to anyone, show them most liked videos on topics they choose
  2. They are subscribed to people, show them their subscribed content creator's videos first, and then any other videos that are similar
past field
#

ok question

#

i have a game that i’ve created called click war

#

and idk if this makes sense

#

but is there a way to add every game state to the database? incase the bot crashes while the lobby is open? or crashes during a game in progress? so it’ll continue when the bot is turned back on

neon flicker
#

In order to initialize both the dashboard and the bot, I should prepare a mutual main .js file which both sets up the bot and configurate the routing right?

pearl trail
#

yes

#

just make sure both bot and webserver can access each other if you want your webserver to access some data from bot

sharp geyser
#

:D

past field
quartz kindle
sharp geyser
#

;c

deft wolf
neon flicker
#
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto  lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">

I'm a little confused with those long-named class names, are they Next.js classes? If so, where can I view the other classes as well?
It is from the default Next.js project

#

Oh, it's tailwind

surreal sage
#

interesting

#

36 bytes per second πŸ”₯

quartz kindle
# warm surge what?

you return if n < 1e3, so afterwards you dont need to check if n >= 1e3 because you know for sure it is, otherwise it would have returned

sharp geyser
#

right guys

#

this seems very empty

deft wolf
neon leaf
#

dam

#

my private bot used in 2 servers got quarantined

neon flicker
#

Lol for what?

neon leaf
neon flicker
#

What might have caused it tho?

neon leaf
#

i mean

#

only thing the bot does that could possibly cause this would be the demo system, a user runs the command, after 1 hour he gets a dm that demo expired and that command has a 24h cooldown

#

may be that its sus for discord when the app had like 5 people get dms on the day the bot was made

#

because people tried demo

solemn latch
#

Join messages/dm? πŸ‘€

neon leaf
#

only place where dms are sent

solemn latch
#

Thats odd

#

Discords anti spam is too strong

neon flicker
#

@solemn latch may I please ask a question like:
Do I have to set up the routing in my main JS file or does Next.js do it for me automatically depending on the folder rotation?

#

Or do I somehow need to initialize it?

sharp geyser
#

nextjs if you are using the app router does it all for you

#

it goes based off folder name

solemn latch
#

yeah

sharp geyser
#
src
--app
---about
----page.tsx
---page.tsx
solemn latch
sharp geyser
#

the page.tsx file in about folder is that folder's "index.html"

#

the page.tsx file in the app folder is your root / "index.html"

sharp geyser
#

Not on the login/join page

#

😭

solemn latch
sharp geyser
#

Here is my updated stuff

solemn latch
#

πŸ‘€ not using shadcn? angeryBOYE

neon flicker
#

Thank you, tho I have some non-routing related questions yet like
I'm confused how to create some sort of "search" box, like when they search something through it how will I create components that will show the results?

solemn latch
solemn latch
neon flicker
#

Not really

solemn latch
#

I would wait to worry about search stuff until later.

neon flicker
#

You're right but it's such a major question mark in my head

#

But yes I think I should start with making the layout first

solemn latch
# neon flicker You're right but it's such a major question mark in my head

Once you play with layout, and general stuff you'll learn a few things along the way like states and useEffect, which will help with how search will work.

Out of all the things in your dashboard search will probably be the most complicated, but it will be way easier to understand after you've displayed information and whatnot.

neon flicker
#

Thank you, it will help me

solemn latch
#

I'm not sure if this approach is right for you right now.

But a component library might be useful.
When I was learning all of this stuff I didn't use component libraries first, I learned everything else then came back to component libraries.
Its up to you what way you want to go.
https://ui.shadcn.com/
https://nextui.org/

shadcn/ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.

NextUI

Beautiful, fast and modern React UI Library

#

I'm a big fan of shadcn, but I've only heard good things about nextui too.

neon flicker
#

Thank you a lot, I really appreciate it again

celest copper
#

Well, What that total revenue actual indicate in the 1st image is it of user

solemn latch
#

Thats just a reference image to what a card looks like in shadcn

neon flicker
#

Where may I view tailwind classes such as this?

solemn latch
#

I pretty much always have it open on an extra monitor when working in tailwind

neon flicker
#

Wow thank you

solemn latch
#

If you use Visual studio code I think theres an extension for tailwind too.

#

for autocomplete

neon flicker
#

I'd really appreciate it

neon flicker
#

Is it called Tailwind CSS IntelliSense`?

solemn latch
#

yep!

neon flicker
#

I'm starting to build the project, I'll start with a basic design

#

As "development" points out that I can always make it better with time so

neon flicker
#

Good, I started getting confused with JSX already

solemn latch
#

whats got you confused?

neon flicker
#

Hydration failed because the initial UI does not match what was rendered on the server.

<body>
<ul style ={{position:'sticky'}}>
  
</ul>
</body>

I just started yet, lol

#

Or I just have lack of HTML knowledge yet

solemn latch
#

Do you have a layout file?

neon flicker
#

Yes, this is what it looks like:

import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata = {
  title: "Page",
  description: "Generated by create next app",
};

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body className={inter.className}>{children}</body>
    </html>
  );
}
solemn latch
#

It might be because you already have a body

neon flicker
#

Oh, you're right

solemn latch
#

Hydration errors are funky right now, in the next 6 months ish they should get better

neon flicker
#

It's weird tho, should I remove the body from the layout file?

#

Ah yes it worked to do so

solemn latch
#

You want your body to be in the layout, as that should be consistent across all pages.

neon flicker
#

So the layout isn't supposed to be included in every single page right?

#

Okay, I thought Next.js required it to do it

solemn latch
#

Yeah, your root layout will be across all pages

neon flicker
#

Ah thank you

#

Yes, I think I have a lot more to worry about before making a search box

#

I don't even know why those rectangle backgrounds are appearing around

eternal osprey
#
 // Send email
    await transporter.sendMail(mailOptions1);
     await transporter.sendMail(mailOptions2);
     await transporter.sendMail(mailOptions3);
 return res.status(200).send({ message: "Received successfully" });```
i have a problem.. when i send the mails with await it is basically making the user wait. I don't want to do that.
Is there a way to send one email, then directly return the status code so that the user doesn't have to wait and then send the other 2 mails (these are admin mails).
#

there's currently a delay of like 5 seconds or something

#

i am deadass r3tarded cuh

#

simply remove the return brev KEKW

#

or i implement a loader y aknow that's also a possibility.

pearl trail
#

ayo chat is this real

eternal osprey
#

Guys i have a service running on port 8443, when i use pm2 restart does it autoamtically release the port or will it block the fucking port?

#

in any case, how can i release the port gracefully?

pearl trail
#

it's not docker so it's open to host

eternal osprey
#

wym gang

pearl trail
#

wdym release the port

eternal osprey
#

i have a process running on port 8443. When i use pm2 restart, it creates a new instance of that process and closes the old one.

#

I am scared that it will return me that the port is still occupied.

pale vessel
#

are you using the same port every time?

#

if it restarts then it won't be occupied until it uses it again

eternal osprey
#

i have one process using 8443 yeah

pearl trail
#

on sigterm, do server.close()

#

iirc it's sigterm

#

or sigkill

pearl trail
#

kinda rare stopped process still have the port occupied

eternal osprey
#

ahh hell nah:

29|EMRE_OFFERTE  | Error: listen EADDRINUSE: address already in use :::8443
29|EMRE_OFFERTE  |     at Server.setupListenHandle [as _listen2] (node:net:1751:16)
29|EMRE_OFFERTE  |     at listenInCluster (node:net:1799:12)
29|EMRE_OFFERTE  |     at Server.listen (node:net:1887:7)
29|EMRE_OFFERTE  |     at Object.<anonymous> (/root/site/offerte.js:267:13)
29|EMRE_OFFERTE  |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
29|EMRE_OFFERTE  |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
29|EMRE_OFFERTE  |     at Module.load (node:internal/modules/cjs/loader:1119:32)
29|EMRE_OFFERTE  |     at Module._load (node:internal/modules/cjs/loader:960:12)
29|EMRE_OFFERTE  |     at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
29|EMRE_OFFERTE  |     at Module._compile (node:internal/modules/cjs/loader:1256:14) {
29|EMRE_OFFERTE  |   code: 'EADDRINUSE',
29|EMRE_OFFERTE  |   errno: -98,
29|EMRE_OFFERTE  |   syscall: 'listen',
29|EMRE_OFFERTE  |   address: '::',
29|EMRE_OFFERTE  |   port: 8443
29|EMRE_OFFERTE  | }```
pale vessel
#

what shows up if you run pm2 list?

#

just that one same process?

eternal osprey
#
root@awsomecordServices:~/site# ps aux | grep 'Z'
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     3310215  0.0  0.0   8900   740 pts/0    S+   19:27   0:00 grep --color=auto Z```
yeah, but as i though pm2 restart does not close the ports, but it closes the process. So the process is closed, but the host still has it bound to the port.
#

it's a zombie process now

pale vessel
#

i thought zombie proceses can't hold ports hmm

pearl trail
#

🧟

pale vessel
#

what happens when you do pm2 stop first and then pm2 restart?

eternal osprey
#

same thing

pale vessel
#

did you do that when it worked the first time?

#

dunno tbh, pm2 restart should work the same as stopping and starting

eternal osprey
#

oh shit

#

i apparently assigned like 4 containers to one index file

#

so when i did pm2 restart index -> it started all 4 containers

pale vessel
#

may as well use docker if you're doing containers

eternal osprey
#

yeah fr

pearl trail
#

jokes aside, I love docker

eternal osprey
#

i got some bad memories in terms of using docker so i kinda hate it

neon flicker
#

Okay, I found it out

quartz kindle
neon flicker
#

So I didn't figure it out

pearl trail
quartz kindle
pearl trail
#

unbelievable πŸ’€πŸ’€πŸ’€

earnest phoenix
#

time to use fastifytrolley

quartz kindle
#

i mean, you cant always trust random benchmarks like that

#

but here is the source

#

some of them went in ruby's favor

#

took them 2.5gb of ram tho

#

:^)

pearl trail
#

uhmmmm don't make me use rust yet

earnest phoenix
#

actually why dont you use c# for backend too

pearl trail
#

I want to try smth different

#

Performance:

  • Express is faster than Rails probably because of its ability to process asynchronous I/O calls
  • However, tasks that entail more cpu intensive requirements generally perform better with Rails
#

icic alr

#

imma do my own benchmark later

quartz kindle
#

why is the comparison express and not node

#

:^)

pearl trail
#

mmLul because that's what I can do

quartz kindle
#

express is thresh

pearl trail
#

well ngl what you said is not entirely wrong

surreal sage
#

the learning curve

#

is beyond long

pearl trail
#

lmao

#

that's my last choice dw

charred nest
#

ive been lurking over waiting for another cpu spike and todays the day lolSPIN i did this, the only thing ive noticed is that one feature gradually slows down when its ran (goes from 0.1 ms and gradually increases to 1400+ ms)

pearl trail
#

ok I decided to use golang, thanks Tim

sharp geyser
neon flicker
#

I think I'm still confused, I don't know which property causes it

#

But I somehow fixed it so I think there's nothing to worry about for now

surreal sage
#

its not that deep docker

sharp geyser
#

apparently it is

surreal sage
#

2 minutes now

#

im guessing its copying my entire 8gb dir

#

damn

#

shoutout to rust for that...

#

im so confused rn

#

damn keyboard double pressed u again

neon leaf
#

idk why but double presses have been going up over the last few weeks for me

surreal sage
#

only happens like every 30th time for me

#

might be just that my keyboard is hella dirty

neon leaf
#

im blaming windows

#

my keyboard is brand new

#

its mostly on c

#

wtf

surreal sage
#

wtffff

neon leaf
#

it just did a triple press

surreal sage
#

new record

neon flicker
#

Is there a way to use to App Router to seperate url.com/home and url.com/home#updates?

lament rock
#

# is usually a markdown thing that just jumps you to a part of the document. I wouldn't recommend intentionally breaking that convention

wheat mesa
#

that was aggressive

surreal sage
#

WHAT??

#

docker??!?!?

#

😭

lament rock
#

Look. I forgot # did that in Discord

neon flicker
#

So should I use url.com/home/updates instead?

lament rock
#

Yeah

wheat mesa
lament rock
#

or just /updates

wheat mesa
#

Yea

neon flicker
#

Well, it's going to be hard to create that dashboard

neon flicker
#

Error: Hydration failed because the initial UI does not match what was rendered on the server.
Expected server HTML to contain a matching <ul> in <body>.
This error is occuring again, it seems to fix it to remove the body from root layout, but then it breaks the whole site

dawn socket
#

how can i add discord support server rather than top.gg server

neon flicker
#

Programming moment, anyways

#

Nevermind, it just sometimes works and it sometimes doesn't

neon flicker
green kestrel
#

you know your bot might be using too many emojis when:

digital swan
green kestrel
#

lol, theres also three more servers im using for the bots emojis but those are my main support server, and two other bots support servers

green kestrel
digital swan
#

multi purpose πŸ€“ but all the emojis are for economy stuff

#

and wordle

deft wolf
rotund slate
#

idk why my bot server and shards count isnt increasing

#
result = await self.get_stats()
            data = {"server_count": int(result["servers"]), "shard_count": int(result["shards"])}

            headers = headers = {
                "Authorization": "secret",
            }
            URL = API_BASE_URL + "/bots/{}/stats".format(self.bot.user.id)
            await self.bot.session.post(URL, headers=headers, data=data)
#

here is my code

frosty gale
# deft wolf

i would make a bot that automatically uploads the emojis for everything as i create new servers

rotund slate
#

this is my get_stats function code

neon flicker
#

<div> with 100% width doesn't cover the whole X axis

#

I feel like I'm going to die

rotund slate
#

and that code is working perfect idk why its not getting update

surreal sage
#

docker try not to ignore the cache level impossible

rotund slate
#

?

quartz kindle
#

try accessing on another device

surreal sage
#

ctrl f5 and incognito (+ network tab "disable cache") my beloved

quartz kindle
#

otherwise try manually making a post request to the website and see if it works

rotund slate
#

Last year i think

quartz kindle
#

try to make a manual request with postman or reqbin or something

rotund slate
#

Ohk let me try

surreal sage
#

WHY IS TS TWEAKING FOR SOME REASON

#

ts extension rn: bye

frosty gale
#

it is the only times i experience issues with my extensions or compilation

#

is when i use react

#

it has more dependencies than a drug addict

quartz kindle
#

react is so slow and bulky that it doesnt actually react to anything in time

frosty gale
#

lol

#

it just feels wrong using it

#

maintainers must be the same people installing is-odd on npm

surreal sage
#

ok docker tweaking?

#

multi layer image

build: node:22-alpine
package: node:22-slim
324 mb

or

build: node:22
package: node:22-alpine
265mb

quartz kindle
#

lol what is the actual difference betwen those?

surreal sage
#

alpine is a way smaller version of normal

#

slim is just node

#

like bare bones

#

slim should be smaller

#

so i dont get it

#

node:22 > node:22-alpine > node:22-slim

#

in sizes (big to small)

quartz kindle
#

whats the difference between build and package tho

surreal sage
#

oh multi layer

#

build just builds the project

#

package just minimizes it completely

eternal osprey
#

i was using spark to view github code and classify them based on language, but one thing that i really noticed was that many people in js in particular tend to do this:

if(condition1){
return ...
}else{
codeblock1
}

but can't you instead use this format to make it more readable/compact?

if(condition1){
return ...
}
codeblock1
surreal sage
#

yes...

#

you dont even need the brackets for the if either 😭 (should use if it's only a return ...

quartz kindle
eternal osprey
#

no like deadass 8gb of html data got me tripping.All of em use the first construct

quartz kindle
surreal sage
#

hmmmmmm

quartz kindle
#

or both slim

surreal sage
#

slim big no

#

its just an empty system with node

quartz kindle
#

sure, run node as a bootloader and ditch the os completely

#

:^)

surreal sage
#

ong

#

ong

#

ong

#

hardcoded iso just to run 1 thing

surreal sage
#

only the package layer matters

quartz kindle
#

so what OS does node slim use?

surreal sage
#

alpine i think

quartz kindle
#

debian

#

theres your answer

surreal sage
#

p sure node:x is debian

#

and not node:x-slim and x-alpine

quartz kindle
surreal sage
#

oh wtf

eternal osprey
#

I do have a problem though guys.
I have around 8tb of data.
I am looking to reduce it to like, 800gb?
So what i came up with was using bloom filters (basically hashes) to check whether certain prominent features of languages fit in a category.
However as of now, my data gets tripled for some reason. I went from 140k entries to 7 million and i have no clue why:
Below snippet is the prominent feature extractor..

val filteredLinks = whs.filter { case (title, _, _) =>
  val lowercaseTitle = title.toLowerCase
  broadcastedToken.value.exists(coin => lowercaseTitle.contains(coin)) &&
  broadcastedLanguages.value.exists(keyword => lowercaseTitle.contains(keyword))
}

val uniqueLinks = filteredLinks.flatMap { case (title, url, body) =>
  val lowercaseTitle = title.toLowerCase
  val mentionedCoins = broadcastedToken.value
    .filter(coin => lowercaseTitle.contains(coin))
    .toSet

  mentionedCoins.map(coin => (coin, (url, body)))
}.groupByKey()
  .mapValues { iter =>
    val aggregatedCount = iter.flatMap { case (_, body) =>
      body.toLowerCase
        .replaceAll("[^a-z0-9\\s]", "")
        .split("\\s+")
        .groupBy(identity).mapValues(_.length).filter { case (word, counter) => word.length > 5 }
    }.groupBy(_._1).mapValues(_.map(_._2).sum)

    aggregatedCount.toSeq.sortBy(-_._2).take(30)
  }

uniqueLinks.foreachPartition { partition =>
  partition.foreach { case (coin, wordCounts) =>
    println(s"\nCoin: $coin, Found Link Count: ${wordCounts.size}")

    val topWords = wordCounts.toList.sortBy(-_._2).take(30)

    topWords.foreach { case (word, count) =>
      println(s"  - $word: $count")
    }
  }
}

spark.stop()

quartz kindle
surreal sage
#

you're infiltrating junior territory with that senior stuff

quartz kindle
#

thats not senior, thats harvard phd

surreal sage
#

go write your own lossless compression lib 😭

eternal osprey
#

trust this is junior data science 😭

quartz kindle
#

how do you even store 8tb

surreal sage
#

raid

quartz kindle
#

do you have a 20tb drive?

surreal sage
#

hard drives

eternal osprey
#

using hdfs

#

the hadoop distributed file system πŸ€“

surreal sage
#

or that

quartz kindle
#

lmao

eternal osprey
#

but i continously get disk errors cuz my data went from 140k -> 7.6 million entries in 2 days.

#

EAACH QUERY TAKES 2 DAYS LMAO 😭

surreal sage
#

man what are you storing

eternal osprey
surreal sage
#

bye 😭

#

couldve said web scrolls

#

πŸ“œ

quartz kindle
#

elder scrolls

eternal osprey
#

it's over for me

quartz kindle
#

what lang is even that?

eternal osprey
#

ii think that i am somehow not removing or deleting the intermediate webcrawls after i processed them.

eternal osprey
quartz kindle
#

never seen scala code before lmao

quartz kindle
#

like how are you even operating here, ddo yu have 8tb of files and you process one file at a time?

surreal sage
#

multi threadingn't

eternal osprey
#

It basically processes it in batches ya know.

quartz kindle
#

how much is loaded into memory at once?

eternal osprey
#

these files are distributed over 128mb blocks across the cluster (=10 machines at the time).
Each machine starts a seperate mapper instance to execute the code on the individual blocks stored there, in paralllel.

#

So each instance has roughly 128mb in memory at the time, and the blocks are evenly stored across the cluster. So as of now, i utilize around 80% of the RAM of each machine but i sometimes tend to get heap errors as well..

#

What i think that the issue is, is that for each web scrawl file that i obtain, i crawl and process all the links that are on that site which creates loops if i don't keep track of the visited links..
What's the best way to quickly check memberships? HashMaps right?

quartz kindle
#

if you are crawling an entire website, then yeah you need to record visited links

#

a hash map is fine

#

or even a set

eternal osprey
#

i see. This explains a lot.

#

the queries used to take 6h but now they take like 2 days.

#

i am processing a lot of data so i don't think i can use HashMaps.. i will have to reserve a lot of memory for the bitvector.

quartz kindle
#

i mean, you would only do it per website

#

once the website is done with, you can delete it

#

or do you have cross links between websites?

#

you can limit crawling within the domain only

eternal osprey
#

it's a raw crawl from like the whole web, so i think they might contain crosslinking.

quartz kindle
#

so you have 2 sets, one holds domains, the other holds paths per domain

eternal osprey
#

wait let me send you an image of the format

quartz kindle
#

for each domain, check domain set to see if it was already done with

#

then for each domain create a set and add paths to it

#

for each path, check the set to see if it was already done with

#

then once all paths were exhausted, delete the set and move on to the next domain

eternal osprey
#

so each warc file, contains these info's.

#

and in that html it can have anchor tags ofc. So the web crawler will then crawl those links again, etc.

eternal osprey
quartz kindle
#

remove anchors/fragments from the url

quartz kindle
#

domain+path

eternal osprey
quartz kindle
#

although there are some websites gthat use anchors for SSR, which is stupid

rotund slate
#

now

#

it is showing curreint in website

eternal osprey
#

The processing in the begin will be the same though, as the webcrawler already crawls it for me and i can't really make it ignore the anchor tags, but the processing that comes after it will definitely be easier.

rotund slate
#

but what is the issue through code/bot

eternal osprey
#

Thank you tim!

quartz kindle
surreal sage
#

im recursively converting images in a dir to a webp
doing this on a single thread atm

do you think it's smarter to multi thread it, e.g. 4 workers

cpu usage with single thread:

#

or is that just dumb if it's alr begging for more cpu

quartz kindle
#

if you only have 1 core, dont bother

surreal sage
#

i have 4 cores

quartz kindle
surreal sage
#

not one thread

#

server provider:

quartz kindle
#

how are you converting?

surreal sage
#

sharp

#

for await loop with klaw

#

(do you see any possible optimizations here)

rotund slate
#

idk why

quartz kindle
surreal sage
#

yea its a binary and not a node script

#

i believe

quartz kindle
#

yes

surreal sage
quartz kindle
rotund slate
#

this is my code

#

aiohttp.ClientSession

#

am using that

quartz kindle
surreal sage
#

effort 6 = 9.71 mb, 5.68s
effort 5 = 9.94 mb, 3.12s
effort 4 = 10 mb, 2.91s
effort 3 = 10 mb, 2.73s

rotund slate
#

thanks for the help ❀️

surreal sage
#

effort to make file size smaller

quartz kindle
#

ah

#

ye not worth it

surreal sage
#

37.5 mb turned down to 10 mb with effort 3

#

so ya 3 it is

quartz kindle
#

ye

#

webp be good

surreal sage
#

love it

quartz kindle
#

ever messed with jpeg2000?

surreal sage
#

not sure if it's a good replacement for png even with quality = 100

surreal sage
quartz kindle
#

i tried it once, was surprisingly good, like 30-40% smaller than jpeg

#

but browser support eeeeeeeeee

#

xD

surreal sage
#

yea then no 😭

quartz kindle
surreal sage
#

i think quality: 100 is that

#

not sure though

#

i was using vercel and the first loaded image was 1.59 mb

#

my data transfer usage skyrocketed

#

i started using webp

#

like 70% reduction

quartz kindle
#

nice

surreal sage
#

not even using vercel anymore

#

only good for hobby projects

#

once you get thousands of visitors/day it's ouch

quartz kindle
#

ye nothing really beats running your own vps

surreal sage
#

using coolify with docker

#

but the image sizes EAT the ssd

#

it was at 50gb after a week, when using nixpacks

lament rock
#

Come down this rabbit hole of pure optimization with us. Say no to bloated frameworks and say hello to pure HTML and JS

#

It's not that bad actually tbh

surreal sage
#

template frameworks

surreal sage
#

full SSR is cool though

lament rock
#

I wrote my dashboard is all pure HTML and JS. Well, TypeScript

surreal sage
#

not always possible

quartz kindle
#

why not

surreal sage
#

ok tbh it's just difficult

#

maybe not impossible

#

are you a print width 80 or 120 coder think

quartz kindle
#

i think its more of a habbit thing

#

if youre used to frameworks, its hard not to use them

lament rock
#

There are some cases where stuff is just better off using something like snowflakes are annoying if you do them all manually and the Discord API requires you to decode the snowflakes to get timestamps

quartz kindle
#

lel

surreal sage
#

2

#

export const DISCORD_EPOCH = 1420070400000

lament rock
#

:)

frosty gale
#

i use uuids for my IDs so you cant even get timestamps

lament rock
#

I mean, some people might want other metadata but yeah

frosty gale
#

(they are unnecessarily long and slow but they look cool)

surreal sage
#

i remember ordering something off a company

quartz kindle
surreal sage
#

the invoice had a mongo objectid as order id

frosty gale
quartz kindle
#

they are liek 100 chars long

#

xD

surreal sage
#

auth tokens have multiple segments

#

one of which being plain json