#development

1 messages · Page 284 of 1

quartz kindle
#

you know whats funny? the geonames api im using requires auth via registered username, and i never made an account with them

#

im using someone else's username that i found on stackoverflow by chance, and it works

#

i'll make my own account eventually, but for now im having fun testing gb's of downloads in someone else's name lmao

pearl trail
#

didn't knew tim is evil

sharp geyser
#

He's gone off the rails lately

prime cliff
#

Today i learned that ubuntu 20.04 breaks ps command because it dosen't support date formatting unlike 22/24.
The option is just completely gone and it's not even a standard thing.

neon leaf
#

I just stopped supporting 20

#

easy fix 👍

prime cliff
#

Was that a mr beast scam.... that's a first

quartz kindle
#

my sparql queries are evolving (thanks to chatgpt, even though most of what it says doesnt work)

neon leaf
#

what the fuck is that

neon leaf
#

wikipedia

sharp geyser
#

What

queen needle
#

It's for wikipedia's API

quartz kindle
quartz kindle
neon leaf
#

why not just graphql 🙏🙏

quartz kindle
#

idk ask them

sharp geyser
#

Just webscrape at this point

queen needle
#

Scraping wikipedia also sucks

neon leaf
#

prob slower

#

you could download the wikipedia archives and convert them to a real db ig

queen needle
#
sharp geyser
#

tim wanting to make everything himself 🧌

quartz kindle
#

@_@

#

im just trying to get as much as i need from a single request

#

so i dont need to do a shit ton of reqs

#

also, some queries are not possible in other apis

#

for example queries that use wikidata properties, like get all pages whose property X equals value Y

sharp geyser
#

Made a very shitty stepper component

#

Not even a component

#

just slapped it into the page itself

queen needle
#

Can I sees

sharp geyser
#

I am telling you it is absolute dogshit

#

and wouldn't be how the end component would look

#

but its a proof of concept

#

It doesn't save state from previous steps either

#

soooo

queen needle
#

Oh I meant how it looked

sharp geyser
#

It works though

#

OH sorry

#

Like I said

#

Dogshit

#

😭

queen needle
#

I mean it works it works tho

#

It's nice

sharp geyser
#

Thankssss

willow ether
#

tsk tsk, using regexes to validate whether something is an email.

sharp geyser
#

tsk tsk tsk I don't care right now

#

Not to be rude

#

It's proof of concept

willow ether
#

lol, I was trying to do a funny sorry

sharp geyser
#

Also, it's not really that slow

willow ether
#

But I'd mark it in a real code review

sharp geyser
#

Indeed

willow ether
#

Its not about speed, its about correctness/maintainability.

sharp geyser
#

What other methods are there to check if something is an email? Cause even things like zod and yup use regex under the hood afaik

willow ether
#

parse it character by character using the official spec; its actually not that hard

neon leaf
#

Math.random trol

willow ether
#

(or just use a library like most people probably do)

sharp geyser
#

I mean yeah most people use zod or yup for that kind of thing

#

but they also use regex

willow ether
#

I wouldn't use one that used regex though but w/e

sharp geyser
#

Not many don't use regex, its easy and not terribly slow. Also for maintainability I dont think the email spec changes that often

willow ether
#

aaand github went down when I tried to look at the regex they're using lol

#

I'm actually wrong lol, the html5 spec literally provides a regex for this use case 🤣

#

<---- suffering from PTSD about regex-based validation mistakes in the past

queen needle
#

I think the best is regex for client side validation and then use email confirmation

#

So it has to be what could be a valid address and then their actual email/an actual email

willow ether
#

Yeah; my (wrong in this case) nitpick is that if you're writing a validator for something, the first instinct of reaching for a regex is probably the wrong choice for non-trivial tasks.

sharp geyser
#

I don't need to any actual email validation

#

I simply am doing a pre-check to make sure their email domain is valid before letting them proceed

queen needle
sharp geyser
#

Saves both me and them effort & time

queen needle
neon leaf
#
type GetPlaceHolders<S extends string> =
  S extends `${string}{${infer W}}${infer RE}`
  ? [W, ...GetPlaceHolders<RE>]
  : []

type Options = GetPlaceHolders<'hello {user}, how are you {day}?'> // 'user' | 'day'
#

(well close enough)

queen needle
#

How tf

neon leaf
#

its not really complex

#

its just pattern matching

#

${string}{${infer W}}${infer RE}
matches *{*}*

#

the content inside {} gets extracted into type var W

#

and I just add that to the array, then take RE (rest of string on right) and run the same type again

#

recursively

#

this is also useful, turning a record into a string union

queen needle
#

I've never really touched the extreme ts types,chow does that export a string?

#

Like if I want to send a message using it or something, bc usually js message.send(interpolate("hi I'm {name}"))

carmine spruce
#

y'know the fun part about logging command usages to see what would need attention for optimizations and such is that I can see when the bot got reviewed from the sudden influx of commands that never saw the light of day

quartz kindle
sharp geyser
#

Believe it or not thats considered basic /j

quartz kindle
#

i'll never do that kind of stuff because i use jsdoc

#

it doesnt support more advanced things :^)

sharp geyser
#

Guys

#

I am trying to get the user's country, should I just have them supply it or should I get it myself

quartz kindle
sharp geyser
#

I can get it via a form yeah just wondering what's most convenient

quartz kindle
#

usually a select menu is the standard way of getting someone's country, unless you need to automate that

sharp geyser
#

I don't need to

#

Right now I am trying to implement stripe

quartz kindle
#

like getting it from their ip address or from browser's locale

sharp geyser
#

and since I don't use hosted dashboards I have to supply the country myself for connect accounts

#

Tempted to make em all US and commit fraud /j

quartz kindle
#

you need to specify the buyer's country?

sharp geyser
#

The seller

quartz kindle
#

the seller?

sharp geyser
#

Yes

quartz kindle
#

like, the website owner

sharp geyser
#

Account owner

quartz kindle
#

or are you registering sellers

sharp geyser
#

yes

quartz kindle
#

ah i see

#

then the seller needs to specify it as accurately as they can

sharp geyser
#

I've gone through like 10+ implementation methods and none of them work effectively

#

Stripe is simply just annoying as fuck to implement

quartz kindle
#

rip

sharp geyser
#

Waiting for someone to either overhaul stripe's api or someone make a better payment gateway cause my god

#

Solo dev implementing stripe at this scale plump_panic

quartz kindle
#

i havent messed with payment gateways yet

#

but i've had my eye on charbee for a while

#

ever tried it?

sharp geyser
#

Yeah but sadly what I am doing I have to use stripe directly for

#

There exists no third party that i've seen that does it

#

Since I am doing seller specific products and not subscriptions

quartz kindle
#

rip

sharp geyser
#

Wanna know what

#

Fuck it

#

I really don't need to make the stripe stuff myself

#

I doubt users will care if they are redirected to stripe

vale sage
queen needle
carmine spruce
#

anyone familiar with incendo's cloud command library?
their server's dead, the docs are.. kinda empty, and I have no idea how suggestions are intended to work

queen needle
#

Send code so users can help

carmine spruce
#

lemme see if I can find the old code I had for it

#

this is what I had a while back, eventually killed it because it just didn't work at all
it's probably not even how you're intended to do it, but there's also no documentation on how you should

carmine spruce
#

actual code that also doesn't work

#

the print statement never goes off, so it's not even running it to my knowledge

carmine spruce
#

the lack of documentation on incendo's part is going to be the death of me

#

either that or the fact it's 2am idk

carmine spruce
#

damn can't get a response from the incendo discord and talking about it here kills the chat 😔

sharp geyser
#

I am starting to branch my backend out to its own thing instead of using nextjs route handlers. Which has led me to use better-auth's jwt plugin. I am wondering how I can manage this in development though. Since the cookies are not shared between the frontend and backend api due to it being on different ports (I guess?) better-auth breaks since the authentication tokens don't exist on the api's context

#

Which causes 401 errors when the backend makes requests to the frontend api to get a jwt token and then validate it on subsequent requests to protected endpoints

#

Actually

#

I am le stupid

#

The frontend should be sending the backend the jwt which it then uses to validate

pearl trail
#

so, how your login flow works? do you login user to nextjs or your own backend? if it's nextjs, you connect your database to nextjs just for auth?

prime cliff
sharp geyser
#

my backend api is written in C# which I want to protect with the same auth system so i use jwts

#

Right now any request made to the backend api must be accompanied with a jwt that the backend then validates using jwks endpoints in the nextjs app

prime cliff
#

Then you can just replicate that while developing either local proxy + backend or you ssh proxy the backend port to your computer

sharp geyser
#

That's fair

#

I learned i dont actually need to care about cookies here

#

I can fetch the jwks without any auth cookies

#

SO I can request the json web key set from the backend and validate the token the frontend sends

wheat mesa
#

It’s the most “secure” way of doing things

sharp geyser
#

What I mean is I don't need cookies for this instance

#

Next JS requests a resource from backend by sending a JWT along with the request
Backend sees this JWT and validates it against a JWKS
If valid responds with the appropriate resource otherwise responds with a 401

#

Initially the jwt is gotten from the cookie on nextjs' side

#

but what I mean there is no need for the cookie to be accessible from the backend since I am just validating the received token

sharp geyser
#

Nextjs will get them from the headers yes

#
await authClient.getSession({
  fetchOptions: {
    onSuccess: (ctx)=>{
      const jwt = ctx.response.headers.get("set-auth-jwt")
    }
  }
})
#

When I fetch the session I also grab the jwt on success from the headers

#

or

#

I can directly call the /token endpoint with the session token in the auth header

pearl trail
#

interesting. i'd usually do allow cookies to be sent through each request credentials: 'include' and then the server will receive the cookie and get session from db. but every individual have their own way

sharp geyser
#

The thing is I am not rolling my own auth system

pearl trail
#

oh

sharp geyser
#

I am using a 3rd party lib

pearl trail
#

yeah in nextjs right?

sharp geyser
#

Yeah

#

It handles all the session and shit for me, and yeah I can get it from the database myself if need be, but why do that when I can use JWTs which is a rather common approach

pearl trail
#

yeah i did that, i used that nextjs auth for discord. when an auth is suceeded, i send to server to create a new session with x token, and then set x to cookie

sharp geyser
#

I mean, my approach isn't much different from others

#

There's so many ways to handle auth

#

especially between microservices

#

JWTs just seems to be the most effective

#

and its built into the lib I use

#

Little integration on my part

pearl trail
#

awesome 🔥

deep cedar
#

Hi I'm trying to build an dashboard (my bot is on discord.py) can somebody give me guides,tips, requirements? This would really help me

compact condor
quartz kindle
#

there are tons of good frameworks

compact condor
sharp geyser
#

Django is also very extensive and not beginner friendly at all

#

If you've never made an api before

quartz kindle
#

well i dont python so i dont know much about their frameworks, but i hear a lot of names thrown around

#

from what i heard, a lot of people say good things about sanic and flask

sharp geyser
#

Flask is good yeah

#

Its more beginner friendly than django

#

Never used fastapi but i hear its pretty well made as well

quartz kindle
#

and of course, i wouldnt be me if i didnt google benchmarks

#

xD

queen needle
sharp geyser
#

He could learn it in 10m

quartz kindle
#

lies

queen needle
#

it's very simple, especially with your extensive js knowledge

compact condor
# sharp geyser Flask is good yeah

flask is very beginner friendly but not solid since every request blocks everything due to flask being sync, for the beginning its pretty good but for moderate traffic it becomes a bottleneck. Fastapi is like flask but faster and fully async supported and uses starlete and pydantic.

neon leaf
#

fixed my missing memory stick 🔥
the issue was a motherboard standoff right below the memory slot causing a short-circuit

quartz kindle
#

at this point just get rid of the disk altogether and go full ramdisk

neon leaf
#

mm

#

I could put the 480gb mc server in ram technically

quartz kindle
#

you have a 480gb mc server?

#

jesus

neon leaf
#

well

#

I pregenerated 60k radius chunks

#

literally no purpose though

quartz kindle
#

lmao

neon leaf
#

idk

#

I was testing pregen performance

#

(its basically same as 9900x)

prime cliff
#

128 GB monkaS

#

You have 500 GB+ ram

quartz kindle
#

you know what would be interesting? an online game (even mc) that has its map roughly connected to people's ip addresses

neon leaf
#

what

quartz kindle
#

so that people close by irl would spawn close by ingame

#

and people far away irl would spawn far away

neon leaf
#

I mean

#

there are world maps for mc

quartz kindle
#

so you could travel ingame to meet people from other countries ingame

neon leaf
#

in different scales

quartz kindle
#

yeah but have people spawn in the correct place based on their ip address

#

of course vps could spoof that

#

but would make for interesting immersive plays

#

imagine you go on a long voyage ingame, and you arrive in places where all players speak some other language

prime cliff
#

I mean bungeecord lets you connect multiple servers all at once too

neon leaf
#

the 1:500 map is 11x4.4GB parts 💀

#

well 50gb isnt horrible

#

there are bigger ones

quartz kindle
#

it doesnt need to be a realistic world map, could be a fantasy one

#

but the idea is to match people based on their irl location

#

and make them travel ingame if they want to meet people from other countries

neon leaf
#

what if they just move and stay somewhere else after travelling 5min one time

quartz kindle
#

sure, thats ingame immigration

neon leaf
quartz kindle
#

imagine you emigrate to ingame's equivalent of japan, so everyone around you is literally japanese people

neon leaf
#

I just think this wouldnt work as intended

#

like people would go where they want

#

and nothing would truly be regional

quartz kindle
#

they are free to do so, but it would be fun

#

i have some weird ideas when it comes to game dev

neon leaf
#

yes

quartz kindle
#

another idea i have is artificial ping/glitches

neon leaf
#

???

quartz kindle
#

the further you travel from your ip-based spawn location, the more laggy the game should feel

#

:^)

neon leaf
#

....

#

well atleast that would keep people in

quartz kindle
#

and it would make for a heck of an adventure

#

venturing as far as you can on increasingly glitchy/laggy environment

#

xD

neon leaf
#

im downloading the 21x4.4gb world map now

quartz kindle
#

xD

prime cliff
#

vibecat Finally got Edge Agent to work which means no more open ip/port access.

lament rock
#

Theyre edging

pearl trail
#

i'd assume this does not cover nested subdomain?

#

ah yeah that's right

quartz kindle
#

you could still use your own SSL

pearl trail
#

so the ip will be exposed

neon leaf
#

@quartz kindle u dis

deft wolf
#

Why does this look a bit like a minecraft map? 🤔

neon leaf
#

(it is a 1:500 map of earth in mc)

deft wolf
#

EarthSMP

neon leaf
#

decent ratio

#

still not very big tho

neon leaf
#

rack done 🔥

quartz kindle
#

how long does it take you to travel the world?

neon leaf
#

it takes ages

#

if you want you can join

#

1.21.5 hde-03.infra.rjns.dev:25106

quartz kindle
#

ill need to update my mc stuff

neon leaf
#

mmm

quartz kindle
#

remember when mc used to be < than 100mb

#

its 500mb+ now

quartz kindle
neon leaf
#

yes, do you need offline mode?

quartz kindle
#

yup

neon leaf
#

mhm

#

try now

harsh nova
neon leaf
quartz kindle
neon leaf
#

what is that render distance 🙏

quartz kindle
#

is was 12 by default, i increased it to max (32) but nothing changed

#

maybe if i reconnect

neon leaf
#

wait ill increase on server

pearl trail
pearl trail
neon leaf
#

32 render distance

quartz kindle
#

i g2g take someone to the bus station

quartz kindle
#

ye view distance improved

quartz kindle
#

we just flew from pakistan to brazil in creative mode

#

took 20 minutes

neon leaf
#

(not worth it)

quartz kindle
#

xDDD

lament rock
rustic nova
#

or something own

neon leaf
#

pl3xmap

rustic nova
#

bluemap is nice

#

Love you sharex for trying to generate 80mb of clips

#

but you have like, parallax

#

street view aah

neon leaf
#

yea

#

bluemap did around 500cps on this map

#

which wouldve taken 1 day

#

pl3xmap did 17000cps

rustic nova
#

topdown only though right?

#

understandable then

#

cat enslaving room btw, for teleporting players back after rejoining

sharp geyser
#
        builder.Services.AddAuthentication("Bearer").AddJwtBearer("Bearer", opt =>
        {
            opt.Authority = "http://localhost:3000";
            opt.Audience = "https://localhost:3000";
            opt.TokenValidationParameters = new TokenValidationParameters
            {
                ValidateAudience = false
            };

            opt.Configuration = new OpenIdConnectConfiguration
            {
                JwksUri = "http://localhost:3000/api/auth/jwks",
            };
        });

Was hoping I could just do this

#

but apparently JwtBearer can't handle the JwksUri thingy

#

that jwks endpoint returns a json response in the jwks format

queen needle
sharp geyser
#

Oh yeah I know of it

#

Basically just keep local cache and stripe synced

#

Didnt need an entire github repo on it

queen needle
#

ah fair, i just knew you were complaining about it and I didn't know if that helped at all

sharp geyser
#

I mean it’s definitely helpful

#

It’s just not the current problem I’m facing ahaha

acoustic bough
#

does smb know how to create such a bar chart breakdown with grafana?

#

I have this rn, but I want different color section thingies depending on what language was used

neon leaf
#

ramdisk 🔥

Run status group 0 (all jobs):
  WRITE: bw=32.9GiB/s (35.3GB/s), 32.9GiB/s-32.9GiB/s (35.3GB/s-35.3GB/s), io=32.0GiB (34.4GB), run=972-972msec
hidden gorge
#

does this look good for our locked access modal

neon leaf
#

zip 🙏🙏

#[inline]
pub fn zip_entry_get_modified_time(
    entry: &zip::read::ZipFile<impl std::io::Read>,
) -> Option<std::time::SystemTime> {
    for field in entry.extra_data_fields() {
        if let zip::extra_fields::ExtraField::ExtendedTimestamp(ext) = field {
            if let Some(mod_time) = ext.mod_time() {
                return Some(
                    std::time::UNIX_EPOCH + std::time::Duration::from_secs(mod_time as u64),
                );
            }
        }
    }

    if let Some(time) = entry.last_modified() {
        if time.is_valid() {
            let chrono_date = chrono::NaiveDate::from_ymd_opt(
                time.year() as i32,
                time.month() as u32,
                time.day() as u32,
            )?;
            let chrono_time = chrono::NaiveTime::from_hms_opt(
                time.hour() as u32,
                time.minute() as u32,
                time.second() as u32,
            )?;

            return Some(
                std::time::UNIX_EPOCH
                    + std::time::Duration::from_secs(
                        chrono_date.and_time(chrono_time).and_utc().timestamp() as u64,
                    ),
            );
        }
    }

    None
}```
acoustic bough
hidden gorge
quartz kindle
#

i would put the icon on top and the text under it

#

or if you want to leave it next to the text, make it a bit smaller and closer to the text

#

another option is make the icon bigger and put the smaller text together with the title, left aligned under it

hidden gorge
#

i need to find out why the text is so far down

quartz kindle
#

which text?

hidden gorge
queen needle
#

Vertical alignment messed up

quartz kindle
#

or inline-block?

hidden gorge
#

I forget

#

I just know it uses span

slow crow
#

Hey quick question so I tried using firebase as a database everything is set up correctly the rules on firestone the code everything even put the code into google gemini lol and it even said it’s correct the error i get when i code my bot with firestone is

“Firestone SDK error no persistence storage is available people download “pip install firestone-admin” but it is installed i have done it 3 times lol anyone know any fixes i also uploaded my crash log from firestone to google gemini and it even said it should work so it might be internal

quartz kindle
quartz kindle
slow crow
#

I’m assuming no but also have no idea what that means im like 6 days deep into discord bot coding

quartz kindle
#

When you initialize Cloud Firestore, you can enable or disable offline persistence:

For Android and Apple platforms, offline persistence is enabled by default. To disable persistence, set the PersistenceEnabled option to false.
For the web, offline persistence is disabled by default. To enable persistence, call the enablePersistence method. Cloud Firestore's cache isn't automatically cleared between sessions. Consequently, if your web app handles sensitive information, make sure to ask the user if they're on a trusted device before enabling persistence.

slow crow
#

Ok my bot is a web app only so then it should be off

#

give me one second I can send you a screen shot

slow crow
hidden gorge
slow crow
#

this is my firebase rules and the error

When I run pip install firebase-admin it shows I already have it installed

quartz kindle
slow crow
#

if I remove that then I can't have firebase as my data base correct?

quartz kindle
slow crow
quartz kindle
# slow crow

you are swallowing the exception and returning your own exception, so it doesnt show what the actual error is

slow crow
#

so i should remove both the line of codes of print

quartz kindle
#

remove the entire try: except:

#

imports shouldnt really be error-handled, as if they error the app shouldnt even attempt to run

#

better to let it crash and let it show any import errors

acoustic bough
pearl trail
acoustic bough
#

idk how else I should design it

deft ridge
vestal sun
#

I have a custom status on my bot, and somehow it randomly disappeared, anyone else have this before?

acoustic bough
acoustic bough
vestal sun
acoustic bough
#

just set it again

deft ridge
acoustic bough
deft ridge
#

thanks!

quartz kindle
neon leaf
#

@quartz kindle I will maybe generate a 1:1 earth map

#

depending on if it fits into 4tb

quartz kindle
neon leaf
#

ye

#

on a sidenote

#

I have a genius idea for an archive format

#

streamable and indexable

#

by splitting it into many smaller indexes that are written every 4mb for example

#

to get all files, you only read the indexes

#

though this already sounds cruel to implement

quartz kindle
#

that seems quite small actually

neon leaf
#

well

#

1:500 is 90gb

#

thats how far i calculated (I didnt)

quartz kindle
neon leaf
#

1kb per block is a bit much

#

especially in newer versions

#

with incremental chunks

quartz kindle
#

even if its 1000x smaller, its still 510tb

neon leaf
#

well I will see ig

quartz kindle
#

lmao

quartz kindle
#

inb4 your computer explodes

neon leaf
#

or I just scan directory before writing data

#

then I can append an index at the start

#

in the order the data will be written

quartz kindle
#

brb grabbing food

deft wolf
#

Imagine 2b2t on a 1:1 scale world map

covert gale
#

it will not fit in 4tb

#

region files are compressed with gzip by default, so you'd wanna switch to something a bit better with space to even attempt that

#

i.e. zstd

gilded current
#

I have a question

prime cliff
#

You didn't say what the question is

quartz kindle
#

classic topgg

wheat mesa
#

I have many questions

queen needle
#

i too have a question

#

what was their question

quartz kindle
#

to ask or not to ask, that is the question

prime cliff
#

Tune in next week for the exciting question!

sharp geyser
#

To do schoolwork that is due today or not do school work thats due today, that is the question

lament rock
#

Just do it while it's being collected

queen needle
#

gaslight the teacher

pearl trail
#

tell the teacher that you’re going to submit late and proceed to submit on time

jaunty mason
#

rate 1/10?

deft wolf
#

1/10

jaunty mason
#

..

#

opinions

#

i respect it

sharp saddle
jaunty mason
#

i have to update some things

wispy python
jaunty mason
#

there isnt much more to add

#

i updated it

#

small things

#

but i dont know what to add

#

since its just a bot

wispy python
jaunty mason
#

that looks good

#

i might have to steal some ideas from that 😭

wispy python
#

haha, no issues

jaunty mason
#

what abt now Dx_bleh

deep merlin
#

I need help in deploying my bot on Heroku. I have command that requires the user to unlock it by voting for the bot on Top.gg. I am using topggpy and discord.py for the bot.

The bot works perfectly when I deploy it on my local machine and expose it using ngrok custom domain. The bot receives Top.gg requests normally.

But on Heroku, when I try to use it's custom domain provided by Heroku, it doesn't work. What can be the reason.

I asked AI and it wants me to make a flask app and receives requests from there, but that still doesn't work.

pearl trail
#

do you set your own port or from env?

deep merlin
pearl trail
#

try to use the port from env. PORT

#

might not 100% work but ig worth a try

deep merlin
#

Alright.

#

Let me try it out.

#

I will let you know.

pearl trail
jaunty mason
#

can anyone be the co dev of my bot 🥀

#

continuous updates tire me the hell out

deep merlin
#

What can be the reason? Why can't I specify the port on Heroku? 🤔

pearl trail
eternal osprey
#

hey, so i cntinosuly spawning my python process in but its so damn slow to startup and exit the model.

I read that we can keep a python worker open, but to be fair, what are the downsides?

#

Won't the worker block concurrent requests from multiple users? It's basically going to sequentialize my code..?

pearl trail
#

run py and your program, and communicate? like using grpc or else

#

py acts as micro service, it runs on its own

quartz kindle
eternal osprey
#

can't we aprallelize the requests somehow

tacit estuary
#

I'm just gonna say I hate discord buttons on discord.py and they make no sense on why they need to be split up into 4 entirely different sections.

I literally can only do buttons through chatgpt and how do they get it to show your local time using that <t:1060002345:f> discord time stamp without it looking highlighted in an embed?! I saw that somewhere. I might figure that out eventually.

quartz kindle
#

if its cpu-intensive, probably not

#

if it does a lot of i/o (disk/network waiting) then probably yes

#

in general, cpu is always blocking, i/o is never blocking

#

cpu needs parallelization/multiple workers, i/o can live with using async in a single worker

dusk tangle
#

since when we can't use custom emoji in footer?

prime cliff
#

You have never been able to use any kind of formatting in footer lol

deft wolf
#

BotGhost is going through the same thing as Shapes now, only it's about tokens xD

delicate zephyr
#

Oh lol

deft wolf
#

Yea, I just went shopping, came back an hour later and everyone is talking about it on ddevs

delicate zephyr
#

Funny meme ngl

tender gale
#

just my curiosity but does this mean none of these bots will be accepted here anymore? I mean since now they're offline because of this announcement 🤔

deft wolf
#

We'll see how it goes. BotGhost wants to fight Discord instead of voluntarily changing its system, so it seems to me that soon it won't be possible to create them at all

#

Most of these bots were not accepted on top.gg anyway because they used "public commands" that were not made by the bot creator

#

So it won't be a big loss for top.gg (and for the entire bot development community as well)

tender gale
#

good point, thank you for explanation peepo_Blush

prime cliff
#

Oh god wtf Shapes had it coming because they did shitty things and message content but now botghost wtf?

I think Discord is overreaching with this token use policy now and it seems like they gave barely any notices or information other than a giant fk u slap it seems.

deft wolf
#

It's possible that these two situations are related and Discord simply doesn't want users to give their bot tokens to third-party services because users are still responsible for what their bot does even if it's not hosted by them or uses someone else's code

#

Apart from the recent BotGhost drama where people managed to compromise dozens if not hundreds of bots and get their tokens

delicate zephyr
#

if all those tokens get breached, depending on scale

#

the sheer amount of user data that can be retrieved is insane

prime cliff
#

@solemn latch scam

pearl trail
#

wow

deft wolf
#

Likely spammer 😔

atomic idol
#

whos the scammer

drifting river
#

hey im need of hackers and spaamer as friends, lets work and break bread

quartz kindle
#

lmao

prime cliff
neon leaf
quartz kindle
neon leaf
#

ye

quartz kindle
#

looking pretty 🔥

neon leaf
#

had to use this "sketchy" thingy

use std::{
    fs::File,
    io::{Read, Seek, SeekFrom},
    os::unix::fs::FileExt,
    sync::Arc,
};

#[derive(Clone)]
pub struct MultiReader {
    file: Arc<File>,
    offset: u64,
}

impl MultiReader {
    pub fn new(file: Arc<File>) -> Self {
        MultiReader { file, offset: 0 }
    }
}

impl Read for MultiReader {
    fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
        let bytes_read = self.file.read_at(buf, self.offset)?;
        self.offset += bytes_read as u64;

        Ok(bytes_read)
    }
}

impl Seek for MultiReader {
    fn seek(&mut self, pos: SeekFrom) -> std::io::Result<u64> {
        self.offset = match pos {
            SeekFrom::Start(offset) => offset,
            SeekFrom::End(offset) => {
                let file_size = self.file.metadata()?.len();
                if offset >= 0 {
                    file_size.saturating_add(offset as u64)
                } else {
                    file_size.saturating_sub((-offset) as u64)
                }
            }
            SeekFrom::Current(offset) => {
                if offset >= 0 {
                    self.offset.saturating_add(offset as u64)
                } else {
                    self.offset.saturating_sub((-offset) as u64)
                }
            }
        };

        Ok(self.offset)
    }
}
#

because the zip lib only seeked once to the start of the entry

#

which then obv got overwritten by another thread

#

so this implements a fake seek that simply stores an offset and uses unix reat_at

elfin helm
#

?av

pearl trail
#

💀

hidden gorge
#

Omg..

hidden gorge
#

ended up making an endpoint system for a ws like express.js routes

queen needle
#

Oh?

#

I treating

#

Interesting*

hidden gorge
# queen needle Interesting*

also each client is assigned an id and a token, to even make a request on that ws you need to supply the ws client token :}

queen needle
#

Makes sense

#

so how do you create a new websocket route

hidden gorge
queen needle
#

ncice

hidden gorge
#

the server then decrypts it and cross checks it

#

is this safe/secure though?

queen needle
#

avoid using deprecated methods but I don't see an issue with it, but people like tim and others will know better than I

hidden gorge
#

?

queen needle
#

I was thinking if this was consistent

#

but since you don't need to decrypt through restarts it's fine

hidden gorge
queen needle
#

if you need to decrypt through restarts like, something is encrypted, restart, needs to be decrypted then you shouldn't generate a random secret and should instead store one in an env

hidden gorge
#

each time a client disconnects and a server restarts the clients token is wiped and reset

quartz kindle
hidden gorge
jaunty mason
#

when ur editing your code editor in itself

quartz kindle
hidden gorge
quartz kindle
hidden gorge
# quartz kindle uh... why?

bc the live chats can contain confidential data that should only be accessed by 2 websockets that need their own tokens

#

each live chat saves the 2 websocket ids

#

to even send or receive anything your token needs to be there in each and every single request.

quartz kindle
#

but auth tokens are usually hashed, not encrypted

hidden gorge
#

well im gonna encrypt messages too

queen needle
#

encrypt everything

hidden gorge
queen needle
#

Why did you capitalize chatData object keys

hidden gorge
#

i'll fix it

prime cliff
#

Since Discord dosen't like token hosted bot services i'm adding my bot creator to Dev Space now so it can be self-hosted 😄
Time to bring it back.

queen needle
#

I like it

#

I had a bot creator a while ago

#

But it used a custom language it wasn't drag and drop, if i were to make one now it would be

sharp geyser
#

I hate scratch

robust musk
#

Hi

willow ether
queen needle
#

Finishing your projects is

willow ether
#

Does anyone but data scientists and children actually use python?

queen needle
#

i used it for robotics 🥺

quartz kindle
prime cliff
#

Oh look at that you can export it HaHa

feral aspen
#
import type { genOgImagePayload } from 'hamoodihajjiri';

export const generateOgImage = (payload: genOgImagePayload) => {
    const hyperLogo = { light: 'hyper-color-logo.svg', dark: 'hyper-color-logo.svg'}

    return ('https://og-image.vercel.app/' + '**' + (payload?.title ?? '') + '**' + '%3Cbr%2F%3E' + (payload?.subTitle ?? '') + '.png?theme=' + (payload.theme ?? 'dark') + '&md=1&fontSize=100px&images=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Ffront%2Fassets%2Fdesign%2F' + hyperLogo[payload.theme ?? 'dark']);
};
#

Anyone knows how to enforce a line break w/ Vercel's OG Image Playground? Apparently, <br/> doesn't work...

feral aspen
quartz kindle
#

idk

#

doesnt look like the title is affected by anything other than basic markdown

feral aspen
#

I think Vercel doesn't support line-breaks entirely

acoustic bough
#

kinda painful how big caches get even when limiting them, default is like 250 messages per channel and I set it to 10 (max 10 mins old), will prob move it to 0 with a keep over limit

vivid fulcrum
#

now imagine the amount of traffic discord has to process in general

#

if you're concerned about memory usage you can probably roll your own cache implementation, caching only what you really need

hidden gorge
light vine
#

your token 😭

hidden gorge
#

you cant use my system at all.

#

its locked down.

#

plus token changes everytime i restart the server.

light vine
#

alr good

hidden gorge
light vine
hidden gorge
hidden gorge
#

finally it works

sharp geyser
#

Watching theos video on just how fucked stripe is, makes it really disheartening to even implement stripe myself 💀

queen needle
#

lmao

sharp geyser
#

I sincerely hope someone at stripe does an overhaul of their "developer friendly" api

winged sphinx
#

Its actually very easy

#

The huge amount of stuff the API have can feel overwhelming but its just that you dont need all the stuff they offer (most of the time)

prime cliff
#

With 1/3 of it being either "depreciated", having different refrences/names or just weird json overall HaHa
Have fun

#

Make sure to keep signing in to the developer portal every 15 mins HaHa and then get randomly captcha'd every 1/5 chance that also breaks on firefox

sharp geyser
#

Because it is anything but easy

#

There's a list of problems that theo outlines that still hold true to this day

acoustic bough
winged sphinx
vivid fulcrum
# acoustic bough that's just awful with djs..

yeah I know. node in general is heavy on storing objects. I don't know what the default caching impl does off the top of my head, however it probably does cache data you don't need. the less fields the better

acoustic bough
#

I already try to limit cache sizes a shit ton, but I do have like 100mb of permission overrides per cluster alone

#

and I'm on bun with JSC rather than node with V8 but yeah still heavy

#

I use roughly 5gb with 19k guilds rn

sharp geyser
winged sphinx
#

Mostly billing & checkout features

sharp geyser
#

Right so you aren't doing too much, that's not as annoying as its other features

#

When you have to start keeping track of a multitude of data that stripe is not reliable at giving you

#

It gets tedious

winged sphinx
#

Like what

sharp geyser
#

checkouts, subs, products, connect accounts, and the webhook events that go along with it that are not sent in sync

#

You can receive those events out of order, and its up to you to decide if they are even valid events or not

#

Since not all of them send with "complete" data

#

or "valid" data since stripe uses temp data in cases where stuff doesn't exist yet and they themselves create

winged sphinx
#

Oh I see what you mean, I agree that having to fetch datas because some webhooks are just empty is annoying but for the webhooks not coming in sync, its often because you failed to acknowledge them so they have to be retried and if Im right you can just use the timestamp to "validate" the data

sharp geyser
#

Not always

#

Stripe literally just doesn't send them in order of whats happened all the time

winged sphinx
#

Oh really, thats weird I never noticed that with any checkout or subs event

sharp geyser
#

I mean yeah

winged sphinx
#

but anyway I guess you can just ignore them if the timestamp isnt right

sharp geyser
#

There's also the fact stripe will not stop 2 sessions from occuring at the same time

#

You can create two checkout sessions at once

#

Its up to you to stop that

winged sphinx
#

I mean, I do not know how you handle it but that sounds normal

sharp geyser
#

No, it shouldn't be normal

#

You shouldn't be allowed to create two checkout sessions at once for the same person on the same order

#

Also it wasn't until recently that stripe allowed you to limit subscriptions per person.

#

So before you had to do annoying checks to see if a sub was still valid, or if they already had one, etc etc

winged sphinx
sharp geyser
#

What would you realistically need control over?

winged sphinx
#

I dont know but you can imagine for a big e-commerce websites that you have many different sessions and you want to handle which session to restore yourself

prime cliff
#

Usually websites will do a cart session based on the local storage

winged sphinx
#

I see, but both ways can probably make sense

#

The biggest issue I encountered recently with Stripe is that you CANNOT customize the invoices issued from Sessions based on information that Stripe collect (like customize the invoice based on the VAT/TAX collect)

#

And it just sounds so dumb when you see all the features you have with invoices and this basic feature is not even available

sharp geyser
prime cliff
warped glacier
#

So i created a webUI that every second generates me a new unique B64 code. The code is based on a mathmatical equation and multiple object positions. What do yall think?

queen needle
#

What's the purpose?

warped glacier
#

It will be used as a encryption key in the future

queen needle
#

Anyone ever use yt-dlp?

I am using it ```ts
function getAudioUrlFromYTDLP(query: string): Promise<string> {
return new Promise((resolve, reject) => {
const process = spawn("py", [
"-m",
"yt_dlp",
"--quiet",
"--no-warnings",
"--no-playlist",
"--default-search",
"ytsearch1:",
"-f",
"bestaudio",
"--get-url",
query,
]);

let output = "";
let error = "";

process.stdout.on("data", (data) => (output += data.toString()));
process.stderr.on("data", (data) => (error += data.toString()));

process.on("close", (code) => {
  if (code === 0 && output.trim()) {
    resolve(output.trim());
  } else {
    reject(new Error(error || "yt-dlp failed or returned empty output"));
  }
});

});
}

quartz kindle
#

its likely downloading the entire video

#
--skip-download                 Do not download the video but write all
                                related files (Alias: --no-download)
lament rock
#

Also, if this kind of thing is going to be done frequently, it'd probably be beneficial to actually do this in python and expose some kind of api through like HTTP or some kind of IPC since compiling the regular expressions every time for ytdlp is really expensive at scale

vivid fulcrum
#

I'm surprised there isn't a native node port of ytdlp 🤔

gilded ice
#

i have a bunch of possibly-null fields that i want to conditionally assign to fields on this
what's the most efficient way of going about this? i don't think i can use nullish coalescing because the right hand side could be nullish too
i came up with the below but i'm not sure if there's a better way to do this

withConfig(config: IConfig): CommandBuilder {
    this.duration = config.duration ? config.duration : this.duration
    // ...
    return this
}
wheat mesa
gilded ice
#

config.duration can be nullish

#

i don't want to apply it in the case that it is

wheat mesa
#

Ah

gilded ice
#

i suppose... if it's already nullish it probably wouldn't matter actually

#

hmm

#

if it breaks i'll be back

wheat mesa
#

I usually do this.duration = config.duration ?? this.duration iirc

gilded ice
#

hmm alright

#

well

#

the thing here is that all my fields have default values

#

i think the above would work

#

yeah

#

thank you

#

lol i haven't used node in years

wheat mesa
#

If config value is provided it’ll override the default, otherwise it’ll stay default

gilded ice
#

yep

#

looks good to me

wheat mesa
#

Null coalescing operator is quite nice

queen needle
quartz kindle
#

doesnt really matter as yt-dlp is designed as a cli program, not a library

queen needle
#

I just added your line to see how it helps

#

Dropped times by like a second

quartz kindle
#

welp, run it through some kind of profiler and see whats taking so long lol

queen needle
#

How would I do that? (this is the first time i've ever had to deal with something taking this long)

quartz kindle
#

python -m profile script.py

queen needle
#
const process = spawn("py", [
      "-m",
      "yt_dlp",
      "--quiet",
      "--no-warnings",
      "--no-playlist",
      "--default-search",
      "ytsearch1:",
      "-f",
      "bestaudio",
      "--get-url",
      "--skip-download",
      query,
    ]);
```  Would it go after -m?
quartz kindle
#

actually idk, since it uses some kind of profiler you need to install separately

queen needle
#

Looking at other uses the only thing I can do is deal with it

#

every reccomendation to make it faster I already have in place, like chunking for streaming

vivid fulcrum
queen needle
#

not really much change

#

I tried seeing if I could use invidious but no public api seemed to work

vivid fulcrum
#

it might just be your network

gilded ice
#

i feel like i'm going crazy

#

okay apparently it's not empty

#

cries

#

i was going crazy

vivid fulcrum
#

might've been a cosmic ray bit flip 🫢

feral aspen
#

i remember your help back in 2021 :)

quartz kindle
#

web dev is so nice when starting out, but then always turns into an unmaintainable clusterfucking headache

#

dozens of scripts, components, hooks, routes, backend functions and all that crap for just a handful of actual webpages

prime cliff
#

Depends how well managed the codebase is, what you're using and how you're laying it out

tropic mantle
#

anyone here know how bot page html works?

quartz kindle
tropic mantle
#

im putting in code but no formatting is showing

#

can i msg u tim

quartz kindle
#

its just every time i work on web dev, complexity grows way more than expected

#

lmao

quartz kindle
tropic mantle
#

so yeah whats the problem

quartz kindle
#

get rid of html,head and body tags

tropic mantle
#

kk

#

is that it

quartz kindle
#

top.gg injects your html into the existing website's html

tropic mantle
#

ah i see

quartz kindle
#

so you need to keep that in mind

#

you can use dev tools to check the html structure what wraps around your content

#

and adapt your css rules for that

tropic mantle
#

👍 where can i find that

quartz kindle
#

browser dev tools / inspect element / F12

tropic mantle
#

alr thanks tim

#

much love

quartz kindle
#

np

queen needle
queen needle
#

Same with a 460 line tsx file i broke up into a bunch of components

quartz kindle
#

im trying to wrap my head around reusability, i always think how i can reuse things, so i make them into components and stuff, but then i always run into situations where my existing reusable thing doesnt quite fit the current thing, so i have to either make a new thing from scratch or edit the existing reusable thing to make it fit in both cases, and then edit all existing implementations of thing to account for changes

#

lmao

queen needle
#

ahh

#

components with like 200 props so it can be used everywhere

quartz kindle
#

lmao

#

for example, i have a component for forms

#

it works nicely for all login/signup/resetpw/etc pages

#

but now im implementing a user profile page, where they can edit their username/password/profile/etc

#

and the form component doesnt fit there

#

because its totally different, both layout and functionality

#

but both use forms

queen needle
#

i never make form components, i make components used for forms, buttons, inputs, confirm inputs, different types of validation then make the forms seperate using them

quartz kindle
#

yeah i go too deep into reusability and then i get fuged

queen needle
#

i do that too though so i get it

#

Like i have a renderTrack component that can be used in 2/5ths of the places where I render tracks

quartz kindle
#

my brain craves organization, but things always run out of control

#

then you enter the endless cycle of refactoring xDDD

queen needle
#

o h

prime cliff
#

Welcome to component hell
-# It's actually pretty organized

queen needle
#

interesting

#

my components lmao

#

don't mind the different naming schemes

prime cliff
#

Why is that single one UpperCase monkaS

queen needle
#

listen

#

I never can figure out how I like to name components

wheat mesa
#

PascalCase for React components, kebab case for Vue components 🙂

#

Actually no

#

Maybe you’re right idek how to name shit

queen needle
#

see

wheat mesa
#

Literally been doing web dev for a living for the past year and still don’t know 🙏

tropic mantle
#

anyone have experience with top.gg bot page

#

im having troubles

queen needle
#

what are you having problems with

tropic mantle
#

thi sis what it looks like:

#

but this is what it should

queen needle
tropic mantle
#

its just not rendering or smth

wheat mesa
#

I use PascalCase for components and camelCase for hooks

prime cliff
#

Maybe the stylesheet or some other request is not loading or loading wrong data?

tropic mantle
#

maybe

#

can i send u my code

queen needle
#

show us your css your using

wheat mesa
#

Send it here

tropic mantle
#

dont flame me but this is cursor 🔥

prime cliff
#

Is there a link too?

queen needle
tropic mantle
#

i dont know how to do frontend

queen needle
#

wait

tropic mantle
#

yes

wheat mesa
#

Holy CSS hell

queen needle
#

lmao

tropic mantle
#

yah i dont understand any of it

queen needle
tropic mantle
#

does anyone have a bot page i could

#

copy

#

☠️

tropic mantle
#

😭

queen needle
#

Javascript and html

quartz kindle
#

i already told you to remove the head/body tags lol

tropic mantle
tropic mantle
quartz kindle
quartz kindle
tropic mantle
#

true i guess

tropic mantle
queen needle
#

accessibility 100

quartz kindle
#

there is no head, no body, no anything else

#

its only one <style> and then raw html

#

and all css rules start with .content

tropic mantle
#

alright thank you sm

quartz kindle
#

because .content is the top.gg element where your description is placed

#

here is how it looks like when rendered in top.gg

tropic mantle
#

ur a goddamn genius

#

@quartz kindle

queen needle
#

that's what we've all been telling him

quartz kindle
#

@_@

tropic mantle
#

how do you learn stuff like this 😭

quartz kindle
#

i've been doing shit like this for 10+ years

queen needle
#

jesus bro is old

quartz kindle
#

im literally twice the age of many people here

vivid fulcrum
vivid fulcrum
# prime cliff 😃

ahh I love c# but god damn is it a nightmare for frontend, at least it was every time I tried to use it for frontend

deft wolf
feral aspen
quartz kindle
gilded ice
#

hey all

#

me again

#

is there a way to avoid exporting a single method from a class?

#
export class Shocker {
    // ...
    static NewInternal(username: string, apiKey: string, id: number) {
        let shocker = new Shocker(username, apiKey, id)
        
        let url = new URL(WS_URL_BASE)
        url.searchParams.append("Username", username)
        url.searchParams.append("ApiKey", apiKey)

        shocker.brokerUrl = url
        shocker.socket = null

        return shocker
    }
    // ...
}```i've tried doing `module.exports.Shocker.NewInternal = null` but surprisingly mixing cjs and esm like this doesn't work i wonder why
#

it sounds like an xy problem because it probably is one :clueless:

pearl trail
#

without static, you can do #FnName(...) and call inside the class using this.#FnName()

#

not sure with static

gilded ice
#

doesn't seem to work unfortunately

#

it's not the end of the world but it would be nice to have

pearl trail
#

oh my bad im wrong

gilded ice
#

hehe oops

quartz kindle
gilded ice
#

private but within the given file instead of just within the class

quartz kindle
#

you want to export the class but not the static method?

#

or what exactly

gilded ice
#

yeah

#

i figured out a better way of getting what i wanted

quartz kindle
#

the only way to do that is to put it outside the class

gilded ice
#

yep

pearl trail
#

revolutionare

gilded ice
#

i'm so smart

quartz kindle
#

i broke my vsc

#

jk, its just a binary file

neon leaf
#

I fixed my vsc

#

(variables are finally properly highlighted in format!)

gilded ice
#

sincerely, a nvim user

quartz kindle
gilded ice
#

i wrote my first node library in ages

#

it rocks

#

i love using rust design patterns where they weren't supposed to be

#

i love that node doesn't have a borrow checker

earnest phoenix
#

yo guys, is there somebody here who is looking for/building complex economy bot

gilded ice
#

i'm sure there are hundreds

earnest phoenix
#

oh but i do really mean complex

neon leaf
gilded ice
earnest phoenix
gilded ice
#

i'm sure there's at least one

neon leaf
#

mutable shared variables

#

on a single thread

gilded ice
#

kiiiiiiinda

wheat mesa
#

Node doesn’t have a borrow checker but it also allows you to shoot yourself in the foot

quartz kindle
lyric mountain
quartz kindle
#

perfect for js

lyric mountain
#

no better duo

hidden gorge
#

Hey.. so we failed to account for almost everything and all our systems collapsed in on each other and we gotta restart, we made the mistake of coding other systems before vital systems. What should we start with?

hidden gorge
#

we dont know where to restart and what to focus on...

quartz kindle
#

broke how?

hidden gorge
# quartz kindle broke how?

failing to work with each system, can barely intergrate with other systems, code is hard to update without errors leading to downtime on production server

#

and the fact the each system has its own database (which im seeing now was a very bad idea)

quartz kindle
#

well, a lot of things could be learned from that, without knowing more details its hard to point them out, but you should be able to see many areas in which you can improve and do different now

#

one thing that comes to mind is that exposed interfaces should rarely ever change

#

for example if you have two systems that talk to each other via messages, even if you need to change them completely inside, the messaging interface should never change, if possible

#

so that changes in one system dont require changes in other systems

#

having multiple databases is not an issue as long as you have cascading effects implemented

#

ie if db2 data depends on db1 data existing, on db1 delete immediately delete from db2 as well

hidden gorge
#

8 databases...

#

only a tiny fraction

quartz kindle
#

if they are all hosted in the same system, consider using tables instead

hidden gorge
#

what sucks is i've been working on all of this since june of last year... :{

quartz kindle
#

welcome to refactor hell

hidden gorge
gilded ice
quartz kindle
#

if you want to launch as soon as possible, create the content first and launch it

#

then slowly implement automation

hidden gorge
quartz kindle
#

rip

hidden gorge
#

but my bloody COO/CTO just stopped doing shit...

quartz kindle
#

rip²

gilded ice
#

lol

neon leaf
#

10th grade graduated

pearl trail
#

wow you're in high school?

grand mango
#

Me wait 2 weeks for my api

#

So i run every command smoothly

#
  • antinuke
#

And whitelist stuff lol

neon leaf
pearl trail
#

ohh i see

prime cliff
#

8 databases..... wtf....

pearl trail
#

i wonder will that much databases is actually better than only 1

prime cliff
hidden gorge
#

so i gotta make a set standard

prime cliff
wheat mesa
#

biggest advice I can give for making large systems

#

AI is alright to use every now and then for things that don't matter that much, but don't let it dictate large portions of your code

#

If you need reliability, LLMs don't provide it

#

I can see a lot of places in the app I work on for my job where AI was used and it created less-than-optimal solutions

quartz kindle
#

maybe there are things you dont need in there, or things that can be combined

wheat mesa
#

it might also be worth mentioning that using nosql databases can be tricky

hidden gorge
wheat mesa
#

From what you've posted in here it looks AI generated

hidden gorge
#

don't make assumptions without proof.

prime cliff
#

he only posted AI gen coded web stuff i believe not database?

#

Although tbh doing it that way does indirectly lead to multiple databases lol

hidden gorge
#

and other stuff

#

livechats even have their own db for that reason

#

but i realized what i can do now to be able to store them all in one

wheat mesa
hidden gorge
#

I will admit in the past I used AI 99% of the time but recently have been moving away from it as it lead to nowhere and broken code....

wheat mesa
#

And for what it's worth, I'm not trying to bash you for it, I'm just trying to give you advice for improvement

#

I had a phase where I was using AI quite a bit

#

Then I realized how terrible it was after a little while

hidden gorge
#

I will be honest again... a tiny bit of our CSS is AI

queen needle
#

I genuinely didn't believe I still knew how to code until my AP CSA exam, and the practice for it because I had gotten so bad with it

wheat mesa
#

It's not a personal attack, I'm just saying to use it with caution

hidden gorge
#

I didn't wanna say it because I felt like i was gonna get judged....

queen needle
#

I think it's good for helping you optimize certain things, help with implementation of an algorithm, or vibe coding a simple like one maybe 2 page site you need

wheat mesa
#

I think that it's okay-ish at solving niche issues that are difficult to describe to google

#

Or at least being used as a "rubber duck"

queen needle
#

It helped me get the implementation for the algorithm to check it a 15 puzzle scramble is valid because I kept reading the algorithm description and was confused, but then after I understood it from the code it gave I created a more optimized solution but I don't think I couldn't have gotten there without it making the first version

hidden gorge
#

it also kinda explained some more things to me and also why im now on ESM :}

wheat mesa
#

The primary issue with AI imo is that it just turns off your brain

hidden gorge
hidden gorge
#

almost as stupid as webster running rm -rf on his vps...

wheat mesa
#

Programming is 85% critical thinking skills

queen needle
#

But the algorithm for 15 puzzle is stupid

wheat mesa
#

There are times where it helps, but I do think that the biggest issue is that it encourages you to offload your thoughts to a machine

#

And at the very core of a good software engineer is the ability to work through issues by thinking about them

queen needle
#

I tried so hard that algorithm was stupid

#

I understand it now, and could implement it myself but before I couldn't

#

I also like when I try to get AI to do something and get fed up with it taking so long I just do it myself

hidden gorge
wheat mesa
#

Yeah this really shouldn't be separate databases

#

These should be separate tables within one db

hidden gorge
#

the rest im doing in a main DB

wheat mesa
#

That's just overly complex for no reason, you don't need a separate database to work concurrently

hidden gorge
queen needle
#

Do you have Prisma experience?

hidden gorge
wheat mesa
#

Separate databases are more warranted when you have services that don't need data from multiple dbs, and are completely independent of one another

hidden gorge
#

well the survey db aint even interacting with the main site 💀

#

its own its own site

#

on*

wheat mesa
#

Still, if it's tangentially related, you probably don't want a separate db

queen needle
#

I've always just used different tables

#

It's easier than multiple databases

wheat mesa
#

For example, what if you want an admin panel on your main site that compiles data from your surveys into reports? You'd need something that can bridge the gap

#

Either that or now you have two different connections open to two different databases that could've been one