swift
md5: 3d15e4f5dfd92367d6c8a20e698c1d05
๐
Swift on the server edition.
>Free beginner resources to get started with HTML, CSS and JShttps://developer.mozilla.org/en-US/docs/Learn - MDN is your friend for web dev fundamentals
https://web.dev/learn/ - Guides by Google, you can also learn concepts like Accessibility, Responsive Design etc
https://eloquentjavascript.net/Eloquent_JavaScript.pdf - A modern introduction to JavaScript
https://javascript.info/ - Quite a good JS tutorial
https://flukeout.github.io/ - Learn CSS selectors in no time
https://flexboxfroggy.com/ and https://cssgridgarden.com/ - Learn flex and grid in CSS
https://roadmap.sh/roadmaps?g=Web+Development - Guided beginner roadmaps
>Resources for backend languageshttps://nodejs.org/en/learn/getting-started/introduction-to-nodejs - An intro to Node.js
https://www.phptutorial.net - A PHP tutorial
https://dev.java/learn/ - A Java tutorial
https://rentry.org/htbby - Links for Python and Go
>Resources for miscellaneous areashttps://github.com/bradtraversy/design-resources-for-developers - List of design resources
https://www.digitalocean.com/community/tutorials - Usually the best guides for everything server related
>Need help? Create an example and post the linkhttps://jsfiddle.net - if you need help with HTML/CSS/JS
https://3v4l.org - if you need help with PHP/HackLang
https://codesandbox.io - if you need help with React/Angular/Vue
/wdg/ may or may not welcome app development discussion. You can post and see what the response is.
Some app technologies of course have overlap with web dev, like React Native, Electron, and Flutter.
We have our own website: https://wdg-one.github.io
Submit your project progress updates using this format in your posts, the scraper will pick it up:
:: my-project-title ::
dev:: anon
tools:: PHP, MySQL, etc.
link:: https://my.website.com
repo:: https://github.com/user/repo
progress:: Lorem ipsum dolor sit amet
Previous:
>>105514952
>mfw need to decide if i should learn go
>>105547536Well, do you want to learn it? That's the important question
>>105547546i think itd be fun, but there are so many languages and i can only pick one for to code the server stuff for my website in.. i just dont wanna pick a bad one
>>105547692>i can only pick one for to code the server stuff for my website inYou can always start with one and rewrite it later if you really want to
heroku dashboard is down, it's over
hi guys, i'm ux designer, i have designed complete website in figma (both desktop and mobile), now boss wants me to code also. i've never coded in my life. what should i do?
they want backend in PHP. it's just information website of a lab (text, images, maybe youtube embed) and just a simple form.
how do i start?
our boss said they are open to anything free, open source and secure technology for website.
I heard you can generate HTML and CSS code with just figma, but what about other? how i am going to do it?
what files do i need to create? what folders? what code?
how do i convince my boss to use wordpress elementor?
>>105548276>they want backend in PHP.Do you know why they want this?
>and just a simple formWhat is the form for? Is it like a "contact us" email thing? Or a questionnaire?
>>105548306i don't know. but it is probably because of security i would assume
yes just a simple "enter email" , "enter your message" contact form.
and yes, i forgot to mention, there is also , "our updates" section where they will show lab updates, news, papers. so i guess backend is needed. but isn't having no-code CMS is good for this type of website??
it's a research lab in a university. they have there own "server" i guess, idk tech term. i mean, no hostinger or godaddy, bluehost. we do have domain name ready.
boss said try to code, he knows i can't code.
>>105548106wouldnt it be hard to rewrite an entire website? i guess its possible at least..
tailwind and effect are based
>>105548370Yeah this sounds ideal for a no-code CMS. What I would do is get some numbers for how long it would take you if you go for a no-code solution. Then figure out how long it would take you to do it by writing a solution yourself - he knows you aren't a coder so you could say "I'd need some spin up time because I'm doing something I'm not familiar with, so that would slow me down and ..., i'd need to make sure it was secure and that's another area that would slow me down and..." and so on. Try to give a schedule for both and just explain why one would be better. If your boss isn't convinced, then you could say something like
>What if we do the no-code solution to start, to make sure our customers/users/whoever can use this. While I'm working on that here, I'll get up to speed with coding on my own time and then if you still want it, I can code it myself afterwards?something like that. In my experience bosses like having options with reasoning in favor of each. Even if there's one you prefer, they like knowing the field so they can sleep better thinking they made the "right" decision, as opposed to just doing whatever was first presented. Change the wording as you want.
>>105548441It might be, but if you're only switching the language it won't be that bad. Think of it less like rewriting and more like translating. You already know what you want, you're just putting it into a different languages syntax. It's if you want to change things that rewriting would be hard, but that's because you're doing novel design work again. It'd be the same as changing it while keeping the language the same in that case.
>>105547059 (OP)Vapor is quite nice to use, but it's way to slow compared to most alternatives.
Also last time I compiled it, it was using mustache and that's pretty much abandonware.
>>105517017Do job interviews really? No testing? 15m? No styling?
I'd still pass the interview but the interview is selecting for all the wrong metrics. There's no situation in the actual world could you release an unfinished product without testing
>>105549597Again
The web is dead
>do the grid tutorial thing
>still no idea how to actually make a grid at the end
seems like thatd be the most important part
>dude I really need to sort out these stack of vulnerabilities in my react project
>okay npm run audit / fix audit
>it does nothing
>right okay
>hmmmmm
>npm update
>still nothing
>check google
>find out its because this old project is using create-react-app which is dead
>ohhhh
>setup a new vite project
>copy my sources over
>proxy config is different and css is broken
>uhhhh
>notice in the move I went from tailwind 3 to 4 and after 20 minutes of looking found that they replaced , for _ in some configs
>everything now all working again
Neat well that was an evening well spent and my project builds way faster now and doesn't have so much shit in the package.json too. A win win.
Is the golden age of webdev over? I remember just a couple of years ago, new groundbreaking frameworks every other weeks, all that shit. And now what do we have? Fucking vercel, AI and muh PaaS shit? Is this all there is?
>>105553661Everything useful has already been made so they had to invent bullshit like SSR react. Webdev hasn't peaked but the existing stuff is already peak. They make new shitty stuff for tech influencer shilling
crashing this thread.. with no survivors!
>>105553661Everything went flat circle and we went from everything on the server to everything on the server (React) and still nothing fucking works.
>>105552991angular doesn't have this problem
>>105548276>Boss asks an UX designer to work as fullstack tooThat can't end well
e2e web testing is a scam.
especially if the app/site is written with a reactive framework:
you are doing everything to not have to write code with vanilla DOM methods, querySelectors, textContents, attributes - and then you add e2e testing on top of that with just a glorified (but of course different) syntax of DOM methods such as querySelectors, textContents and attributes only in order to test things which you would not have to test if you simply did not use a frontend (meta) framework
>>105553661the golden age is right now, just look at how versatile the web platforms have become! you don't need React or any of that shit for anything, it's all very simple to do by yourself (and you should)
>>105557362genx boomers hate when they're confronted with something they don't know.
/wdg/ is dying but I will do what I can to save it
>>105561191sorry anon, /g/ is just too fast..
>>105547059 (OP)I had a dream last night that my friend asked me to make him a mobile app so I pulled an all nighter learning Java then making the app, and when I woke up my app was in c++ for some reason and no one knew why
I fucking hate Rustfags so fucking much.
MS announces rewriting TypeScript in GO and all the Rustrannies literally start FOAMING AT THE MOUTH screaming WHY NOT RUST?!??!?!
>>105562698I've been playing around with making a mobile app and I also played around with making a Progressive Web App. PWAs are pretty cool and can do a lot these days, but they still lack a bit, compared to native apps. Fucking Apple and Google bastards. The problem with native apps is that you need to pay Apple to put your app in the App Store (I think it's $99 a year) and you need to pay Google to put your app in the Play Store (I think theirs is a one off fee of $25, much cheaper)
not sure if I should focus on .net or java and spring
>any comments area
>muhammad
>aditya
>aneesh
>rajesh
>thank you bro
How do we escape them
>>105517017Phone attempt here we go
Function stopwatch(){
Const [timeS, setTimeS] = useState(0);
Const [playing, setPlaying] = useState(true);
Useeffect(() => {
Const Unsub = SetTimeout(()=>{}, 1000 );
Return ()=>{ Unsub() }
},[playing])
Return (
<Div>
Current time:
<span className="m">{timeS / 60}</span>
<Span className="s">{timeS% 60}</span>
<Button onClick={() => setPlaying(true)}/>
<Button onClick={() => setPlaying(false)}/>
<Button onClick={() => {setPlaying(false)}; setTimes(0)}/>
</div>
)
}
>>105566979Shit it should start off false and I'm too lazy for onClick text and brackets
>>105566979Forgot if statement in useeffect ah fuck it
I don't know what to work on. Is there anywhere you can go to help other people build stuff? Specifically web development stuff? Maybe almost like volunteering or something would be good for me.
I have an old pc that I want to host a website on. What do? Which distros does /g/ recommend? And what tools for developing web pages?
I'm inexperienced, but fairly tech-literate.
>>105567988Not the worst page: https://landchad.net/
I like Debian Stable and VS Code
>>105567697Just save the access and refresh tokens in localstorage pepega
>1 hour technical interview with two senior devs
Fucking hate these humiliation rituals
>tRPC
>zod
>drizzle
>>typescript lsp takes seconds to update
tsgo can't come soon enough
>>105564293I've done mobile apps before. The hardest part is bending over backwards for Google and apple with all the eula and tos shit and making sure everything is up to their standard. I used capacitor and made by alpine.js code just werk for mobile. It was the easy part. Apple also wants you to have a fucking Mac and iPhone to publish your app and compile it. I understand an iPhone but there's no reason I have to have a fucking Mac. They're just being cunts.
>>105564207Rust is kind of pointless imo now that c++ has memory safety. That was their big argument against c++. C++ is also typically faster, and already has a massive ecosystem for everything you need.
But what really makes it pointless to me is Zig. If you want to use a new language Zig is easier and more secure than rust, and typically even beats c++ in performance tests. There's no reason to use Rust when modern c++ and Zig exists. It's like choosing react for a new app because it was the shiny new toy 10 years ago despite it now being dated by newer better frameworks, and most sites just use legacy shit like WordPress and fucking jquery anyways so the industry standard argument is bullshit as well.
Of all the server side rendering frameworks I used like next, php, WordPress (if you can call it that), laravel, ruby on rails, jade/pug years ago, etc...
Astro is by far my favorite.
>>105569559>he didnโt try next or tanstack
>>105566979Thanks to the one guy that attempted it. True this can be generated in 10 seconds with an llm, but I was asked to do it live and just wanted to see who else could do it. I would never write this shit from scratch nowadays.
Whyโs this thread so dead since most software is web based
>>105569610Literally the first one mentioned.
>>105569627See the post above you. The world is full of retards who don't want to do anything because they can just ask AI. "I would never write this shit from scratch"
What's the point of asking this niche thread where no one will respond to your question usually anyways when you can ask GPT?
The only point of these threads is general discussion anymore such as talking shit about someone else's stack. There's not a single code tag in the entire thread, people don't post code here anymore.
>>105570149an anon helped me with something a few threads back
>>105570149we had some easy code challenges a thread or two back, be the change you want to see
Is using view engines standard practice?
>>105565889Java 100%. C# you're limited to M$ ecosystem.
Is there any website with benchmarks of various MongoDB versions from 4.4 all the way to 8.0? I've been thinking of upgrading, but turns out that performance has been degrading since 4.4 consistently, and I was wondering how does it compare to 8.0 where they tried to get it back to 4.4 levels. I know that I should run my own benchmarks with my own loads, but it's a hell of a pain to set up when I'm almost soloing the company's backend and infra.
>>105571224I don't think that's true anymore, remember reading about it running on linux as well, and I've ran it with mysql myself
Why hasn't anyone tried to make a Python or Javascript framework with Rails-esque magic? Something like Python on Pails or JS in Jails.
>>105547692>and i can only pick one for to code the server stuff for my website inwhy not pick the language designed for writing server code? (go)
My company is hiring an outside company to handle an addition to our product.
This is something any of us developers are capable of doing.
They said we are "testing them out"
I looked into the company and they have a job listing for a developer, location in India.
Are we being replaced?
>>105573197>PythonDjango is relatively similar to Rails
>JavaScriptI think there are attempts at such a thing - there's something called Redwood JS but I've never used it. It's probably simpler to just use Express and add on other bits if you need them, like an ORM, templating if you need it, etc.
How do you guys test your projects? Do you guys have a bunch of browsers installed or is your main browser enough?
>>105574113You may be able to use browserstack for free.
>>105571720If you're using mongoose anyways just switch to prisma and postgres or mysql or whatever else you want. It takes like an hour to learn the ORM prisma and you can basically GPT your model into the prisma schema, then easily GPT all the API calls to use prisma calls instead of mongoose.
There's no reason to use Mongo anymore.
>>105574113how old are you? lol
Chrome.
Only test in other browsers if users are bitching about it not working and they are paying users.
file
md5: 6d7e39bebf9b0b61d2332cf0b7cee587
๐
why is this still a thing
>>105574701Spring + Morphia (and some occasional Spring Data), we're a Java shop. The project is too big now to switch to SQL, it would take months and we'd have to redo all of the analytics too, so we're stuck with what we have. I would like to migrate myself if possible, but it's just not realistic.
>>105574773Can you elaborate? It looks normal to me
>>105574773it isn't, do 100vh and 100vw
Added smilies to my forum (on top of BBcode).
Yes I ripped them off. Do you recognize from where?
>>105574773Because <body> takes up as much height as it requires. add
body {
min-height: 100vh;
}
What is the use case for writing server code in Swift? Making it harder to hire people to maintain it in the future? Even on iOS Swift has been a maintenance nightmare with how frequently it makes big changes.
>>105574883Understandable. I'd say you could migrate to postgres json but its even slower than mongo lmao
>>105575693I didn't even think people used swift outside of iOS.
>>105575693>server code in swiftwtf I thought it only worked on iOS??
>>105575693>>105576207>>105576232I guess if you already know Swift then you could use it to write a server application
Also Swift runs on Linux and Windows these days. Apple wants to increase adoption.
>>105575693Same reason people want to write server code in javascript. You only need to know one language, and you can share dependencies between both projects
>>105569623honestly as far as tasks go i dont think its that unreasonable. assuming it's live coding you could describe your thought process as well. i'd imagine the key thing they are after is how the setTimeout is handled and the different buttons onClicks. and I say this as a go day job person.
file
md5: b44e1215ab878bc1762e6af15462519e
๐
>>105575679>>105574996>>105574884Had to do this for it to work. If this isn't the default in every browser at the end of the year i will quit web dev.
How do I expose my services (TCP and UDP) without revealing my IP address (and also without running on Tor or I2P or similar latency-based systems)?
>>105578111Not exactly what you asked but for HTTP and WebSockets you can use cloudflare tunnel.
>>105578182>cloudflare tunnelI thought I looked at that a little while ago but it was all fucked. Does it allow for something like port forwarding? Do users need to install shit to use it, or is it just out on the Internet available to them?
I just started my own local web related business and made a few grand today for a few hours of work.
I hit the gold mine and found an ultra niche yet in demand business.
>>105551410css is absurd. no one remembers it, everyone looks it up whenever they need to do something
>>105577615wait until you discover you need yet a different value for it to work on mobile properly
>>105578448Give us more info
>>105547059 (OP)Can someone explain why my getElementById isnt working?
>>105579578Try document.querySelectory("#h1id")
querySelector is more widely used now since you can geab whatever.
>>105579578Add a "defer" attribute to your <script src=...
>>105579793Or he could just move the script lower
>>105578894All web infrastructure is absurd starting with html and http
>>105578894I remember every bit of it.
>>105579790I never use querySelector because apparently it's slower, so I get elements by ID. But most of the time I'm using React instead.
>>105578245You install cloudflared on your server. Then you log into the Zero Trust dashboard and add a tunnel to point to a location (e.g. point project.youtdomain.com to localhost:8000).
Why are even the simplest of things hard as fuck to do in Django? Everything is complex and shrouded in veil of mystery
Since python is badically pseudocode, i thought pythons most popular framework would also be simple.
Js is trash but node is 100 times more simple
>>105580775>Js is trashWhy do you believe this? I like JS and TS
>>105580949Js is fine i guess but theres weird and illogical stuff going on there. Node is easy and simple so i like it
>>105579578https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/How_browsers_work
>When the parser finds non-blocking resources, such as an image, the browser will request those resources and continue parsing. Parsing can continue when a CSS file is encountered, but <script> elements โ particularly those without an async or defer attribute โ block rendering, and pause the parsing of HTML. Though the browser's preload scanner hastens this process, excessive scripts can still be a significant bottleneck.In your case the browser hasn't parsed (and so doesn't have) anything in your body section when it runs script.js. You could use defer on the <script> element to parse in the body and then your script would do what you expected.
Lads. I stopped my antidepressant and my programming productivity has declined. I'm now lazy and I play video games instead.
Maybe I should go back on the antidepressant so I can program more.
>>105580775Django is the worst framework in existence. It was extracted from an online newspaper after all. Unless your app is a CMS in some form, you're always fighting the framework.
In general, for web stuff, python is awful.
>>105581572ha, yeah it is.
I've had jobs in several languages and frameworks and django was awful. I worked there for a year and never fully figured it out.
>>105581586So, whatโs good then, anon?
>>105581604PHP.
I prefer working without a framework but Laravel is ok, and so is Symfony.
I would stick with python if you're looking for a job though, as it gives a good path into AI/ML.
With PHP you're in constant competition with overseas workers.
currently doing a copilot medium js challenge, making me sweat bullets
>>105581973here again, it's very cool, I think I like it more than chatgpt, I'm getting the company version, so that makes sense, anyways, AI is a good mentor or exercise buddy
I wrote a script in C and ran the resulting executable on Apache with CGI. With ApacheBench I got 250 requests per second on a Raspberry PI.
Then I wrote a FastCGI test script in C and ran it on Apache with FastCGI (mod_fcgid). With ApacheBench I get around 100 requests per second. Doesn't make any sense to me.
For comparison PHP with mod_php gets around 1500 requests per second with the same parameters.
>>105582875>>105581973kms moment though, was when I asked it for a js challenge and it told me to do fizzbuzz, that was tough
>>105582934mentally, as in, fuck, shit, I've been programming for 6+ years, and this bitch thinks I'm on fizzbuzz level
>>105548276Just do locked down Wordpress and code the templates with ChatGPT's help. But you're a designer (presumably a retard) so expecting you to write code is hilarious.
>jakarta.persistence.AttributeConverter
I love java so much it's so peak nothing will ever top java bros
>>105582893PHP is extremely optimized today and it compiles to better C code than you'll ever write.
Question lads, should I make:
1) A progressive web app which can work on smartphones
OR
2) A native smartphone app using React Native
I think the second option is probably easier and better (because progressive web apps have quirks). But I'm a cheapskate and I don't want to pay Apple and Google money to list apps in their app stores. The advantage of a progressive web app is that you just host it on the open internet.
>>1055836363) Progressive web app that has a native app build which is webview + JS bridge for native functions
>>105583636It depends on what you want, if your goal is to have users and make money you will shoot yourself in the foot by not have an app on the store and Zoomers and Gen Alpha don't even use websites now.
>>105574773What?
Everything looks as it should.
>>105579578Use querySelector, getElementByX etc. methods are outdated and shit.
>>105577615>why don't they rewrite the spec because I have an opinion on how it should workHTML wasn't made to create apps, it was basically designed around concepts we understand in printing except the entire web page is like an infinitely long piece of paper. The concept of having containers (by default) being 100% height greedy is not what the spec was designed around. It's a document format, every container is designed to grow based on the content within and in 99% of use cases that's what people want. Even this website only works sanely because of this premise.
If you want more control over layout there are advanced containers and even simple position relative and absolute shenanigans which is how you do UI in Android, iOS and even game engines.
>>105579578Because your script runs before the HTML exists. The easiest solution is putting <script> just before the closing </body> otherwise you have to put it inside a load event. This is also good practice because <script> is a render blocking element.
>>105582893Yep, that does not make sense. Post minimal viable test script here so we can check that stuff out.
Fuck, I miss cgi. Those were the days. Everything was so damn simple.
>>105580553Frontend speed doesn't matter much unironically as long as you're not using some massively bloated framework. You're not going to create lag grabbing some elements with vanilla javascript in a small ass website lmao
>>105584904After writing web apps for years I have never had querySelector() be a bottle neck and honestly if you're at the point of having tens of thousands of elements you are likely bottlenecked by other things and if you keep basic hygiene of scoping your query selectors it's never going to be a problem.
e.g.
container = document.querySelector(".container")
el = container.querySelector(".thing")
>>105584079Maybe I should look into that but I think Apple generally doesn't like it if your App Store app is just a webview:
>Your app should include features, content, and UI that elevate it beyond a repackaged website.https://developer.apple.com/app-store/review/guidelines/#minimum-functionality
Maybe there are ways to make it work though
>>105584094Ultimately I want users, and maybe to make money.
I like the idea of a progressive web app because you can add it to your home screen on an iPhone and it will function essentially like a normal app. By doing this, you can avoid app store fees and regulations etc.
But maybe you're right that today's users expect to get things from the app store. If I want to do that though then I'd have to pay Apple $99 a year to list in the app store, and I think it's $25 to Google (one off fee) to list in the Google Play store.
>>105585464If your "app" is just a website then it's not something anyone wants to use either. What Apples policy wants is you not to put a website in an app and the test is "does this look like a mobile version of a website?" (yes/no). If you aren't going to make $125/yr for your app idea to cover a year of your costs then you don't have a very good idea.
>>105585551>If you aren't going to make $125/yr for your app idea to cover a year of your costs then you don't have a very good ideaI guess my main motivation for making an app (or web app) is not the money it could make. Perhaps it would make no money. I just want to see if I can make something which people want to use. As a technical challenge I guess. And if I make something good then I can show it to employers.
>>105585668Just do it on Android then
>>105585718Maybe I'll just try a basic progressive web app for now, which iPhone and Android users could both use
>>105585940almost no one will use it on their phone just fyi
>>105584439Retard take. getElementByx does a simple hash table lookup. querySelector has to parse your query then it can perform the lookup. Use querySelector when you need to do a legit query more complex than a single Id or className. Use getElementByx for simpler cases like an id or className.
Can someone help me out? I run cursor with several mdc files but my project is a large scale enterprise app and there's like 10 mdc files, the api one alone is like 700 lines long with all the conventions and important information that relates to the backend. I use claude 4 sonnet (thinking) and it's been a blast.
The problem is the context is too small to include all of these for each agent prompt. Is there a way to improve the context so it can read all of them before answering? I've read something about MCP servers but I don't quite understand if that would alleviate my issue.
It seems to me all I need to truly vibe code is a brain that knows all about my codebase and when I prompt it doesn't have to re-read all these files over and over again but actually knows the ins and outs of my app.
>>105586022>bro microoptimize using id tags to save 0.01 microsecondsHoly shit you wasted more time writing about that than me doing querySelector 1 million times.
>>105586453Just to add:
- you waste time juggling unique ids (and if you're doing this you AT MAX have like 100 elements with ids on a production website)
- most websites DO NOT just have a single convenient id for each environment and in practice the only thing that makes sense is id for label/input pairs
- you waste time dealing with things with ids instead of using regular querySelector queries
- if you're considering unique ids, you can just quad tree your selectors by not doing document.querySelector like a dumbass and cache nodes like "sidebar.querySelector" or "table.querySelector"
- it's 2025 not 1998
>>105579578Script is too high up. It runs before the DOM element you want to select exists.
Either run the code you want to run in a DOMContentLoaded event handler, or just add the defer attribute to the script, OR place the script at the bottom of <body>.
>>105586436>prompt it doesn't have to re-read all these files over and over again but actually knows the ins and outs of my app.not happening
>>105586574Yeah it is. Here's the holy grail. Feed your context and cache it with Gemini's 1m context window, then use claude on cursor to do the actual thinking and response.
https://github.com/ogoldberg/gemini-context-mcp-server
>>105587750>context cachekek
>>105586436>doesn't have to re-read all these files over and over againbut yeah i already do what you described
mcp
md5: 7da4e74ae97b19d59bdf010e7c2e055d
๐
>>105587804pic related, I'll try it out because I'm tired of feeding it several files and using mdc rules to make the AI produce better results. If I can run this locally the only worry I have is sharing data with Gemini but it is what it is
>>105586436Are you using oss libs? you could install context7 into cursor:
https://github.com/upstash/context7
and the link to install it:
https://cursor.com/install-mcp?name=context7&config=eyJ1cmwiOiJodHRwczovL21jcC5jb250ZXh0Ny5jb20vbWNwIn0%3D
Otherwise yeah you may want to consider adding rules (like pic related)
>>105587882My rules right now are literally "read api.md before making changes" when touching api/* files, or "read overview.md and roadmap.md before making changes" all the time for each prompt. It gets out of hand fast, because these files have over 1000 lines of text.
I'll check out context7, I've also read about other things like Roo Code. I just think if there was a way to persist and remember the intricacies of a codebase you'd be superpowered to just go in and vibe. Seems like that context window is the real bottleneck but hopefully the technology improves and you get amazing code like with sonnet-4 and the AI has a working short and long-term brain that doesn't treat every conversation in your codebase as a one off code change but actually considers your patterns, workflows, architectural design etc.
>>105586436>Is there a way to improve the context so it can read all of them before answering?not really, it's just a fundamental limitation of llms right now. tools like the gemini thing someone else mentioned are just bandaids on the limitation
using sonnet i've always found that going back and forth with it to build a PRD/todo list helps a lot, since you can start a new thread and refer back to it
I know fuck all about front-end. Are these static site generators (Jekyll, Hugo, Eleventy, Gatsby) good enough if I just want to make a blog/portfolio app?
>>105589123Yep. I'd use Astro for that. Piss easy, basically html without any graphql shit (gatsby) and no forced framework / markdown shit (jekyll/hugo).
>>105589254Nice. I was considering Gatsby, but I might take a look at Astro instead.
I'm making my million dollar website which will make me a millionaire and I'm only using js in script tags and express
I'm making a news aggregator. Dubs decides my backend framework. Your options are Flask, Django, FastAPI.
I need a bit of help with an application I am building using Laravel and Supabase (which I only use as a database). It is a game, and I'd like to identify my users (to keep their score, game state, etc.) without actually having them register an account.
I thought about doing this with Laravel Sessions, so I made a middleware with the following code: public function handle(Request $request, Closure $next)
{
if (!$request->session()->has('userId')) {
$request->session()->put('userId', (string) Str::uuid());
}
return $next($request);
}
which is called on every request using ->withMiddleware() in bootstrap/app.php
I have set a long session expiration, but I noticed that going back to the site after a while returns a different userId.
As you may have figured I am not very experienced and in fact know very little about all this, so I'd be very grateful if you could point me to some resource, or explain how all this works (and why it doesn't in my case).
Would I be better off actually setting up proper authentication? In that case, I would like to have the user register through social media instead of regular email/password, how can I achieve that using Laravel?
>>105590211> It is a game, and I'd like to identify my users (to keep their score, game state, etc.) without actually having them register an account.Are they supposed to be able to come back next day and play from the same spot? If so, I don't think this will work at all. They'll return tomorrow but their session will be gone so they won't have the userId anymore to retrieve it with right?
>As you may have figured I am not very experienced and in fact know very little about all this, so I'd be very grateful if you could point me to some resource, or explain how all this works (and why it doesn't in my case).from
>https://www.php.net/manual/en/function.session-destroy.phpIt seems like you may be running into a complication of strict mode (assuming you have it enabled). Maybe you still have the old session info on your browser but your server no longer recognizes it and so gives you a new id.
>In that case, I would like to have the user register through social media instead of regular email/password, how can I achieve that using Laravel?KeyCloak should be usable with PHP and can support social media login.
I think it might be easier for you when developing to support a basic user/pass authentication and then when you have the game working the way you like, it should be just a final push to integrate keycloak (and it will let you put off worrying about authentication until you can focus on it, so you can focus on the game/logic/design for now). Sorry I don't know PHP so I can't help more
>>105590211>I have set a long session expiration, but I noticed that going back to the site after a while returns a different userIdThat might be because the cookie (laravel_session) had expired on your browser between your changes in config/session.php. Check the lifetime using your dev tools.
Also, Is there even a reason you need to store the uuid in the session? You can always retrieve the session id:
https://api.laravel.com/docs/12.x/Illuminate/Contracts/Session/Session.html#method_getId
>I would like to have the user register through social media instead of regular email/password, how can I achieve that using Laravel?Socialite is probably the best way to do this, but you may need to know a bit about how the OAuth flow works cause the docs otherwise could be confusing.
https://laravel.com/docs/12.x/socialite
>>105590303Yeah the game is done already, this is basically all that's left to do. I'll just bite the bullet and implement authentication.
>>105590409I had made a mistake writing the expiration time, it seems to work better now but still not perfect: I set 1800000 minutes (1250 days) but a new cookie will have the expiration date set to July 19, 2026 (could this be a browser feature to prevent excessively long expiration dates?)
Anyway, as I said, I think I'll just use regular authentication. I'd like to use Twitch but it seems like Socialite doesn't have a driver for it, do you happen to know something that would suit me?
>>105590487>(could this be a browser feature to prevent excessively long expiration dates?)Yes, depends on the browser. You can't store cookies forever.
>Anyway, as I said, I think I'll just use regular authentication. I'd like to use Twitch but it seems like Socialite doesn't have a driver for it, do you happen to know something that would suit me?There's third party providers you'll need to install for that
https://socialiteproviders.com/Twitch/
>>105590487>implement authentication.nta, sounds for the best honestly, usernames, leaderboards, and cross device accounts
>>105590512Sounds great, thanks!
>>105590544>>105590512nta, thanks, fukken saved
>>105589957What kind of website lad
>>105590142Whichever you prefer
>>105590780Well obviously I can't tell you, I don't want you to make milion dollars with it before I do
Do you know any tutorials where the end result actually looks good? I want to elevate my css design skills a bit.
>>105590991no, but you can have this
/*design*/
https://medium.com/refactoring-ui/7-practical-tips-for-cheating-at-design-40c736799886
/*desing inspiration web*/
https://dribbble.com/
https://www.uplabs.com/
https://www.behance.net/
http://www.goodweb.design/
https://onepagelove.com/
https://www.awwwards.com/
https://medium.com/refactoring-ui/7-practical-tips-for-cheating-at-design-40c736799886
https://codepen.io/nicolaspavlotsky/full/ZJPXgy
https://hype4.academy/articles/design/glassmorphism-in-user-interfaces
/* fonts */
https://fontpair.co/
/* design theory */
https://www.ibm.com/design/language/illustration/flat-style/design/
https://www.ibm.com/design/language/
/* hosts refactoring UI pdf */
https://z-lib.org/
/* design from refactor ui dude */
https://twitter.com/i/events/880688233641848832?lang=fr
https://www.youtube.com/watch?v=7Z9rrryIOC4 [Embed]
https://gofile.io/d/KCQMw2
most might be a bit ubdated but it's what I have
>>105590991>css tutorialsidk but
android and ios have official design guidelines but you can apply most of them elsewhere too
and google has m2 and m3 material design e.g https://m3.material.io/components
Does adsense pay well for single page web apps
>>105591783I hope not. Fuck SPAs. 99% of them are fucking niggerlicious and can't handle the fucking refresh button or back/forward buttons properly.
>>105591844SPAs are good, I'm making one, and it handles refresh/back/forward properly
Sometimes a more traditional website makes more sense. But SPAs can sometimes be more efficient. And an SPA can act more similarly to a native application. Which is pretty cool, because you're just writing one app and you know it will run on many devices and platforms, because practically all devices these days have a web browser.
>>105591844>>105592450nta, spas are cool af, the drawbacks exist, but they really shouldn't and with this I mean that js/browsers should integrate SPA functionality natively, same way search engines should be bitch slapped into indexing them properly
>>105591783Unless you're in a high CPC category... no. And your target audience likely uses ad blockers. The only way to make money is to have something that people will swipe a credit card for and that you can affordably advertise (on Adwords) with ROI.
>>105592607I'm going to rape you
>>105592614>bro I'm going to use Adsense on a SPA that won't have any organic traffic because it won't rank on any search engine
>>105592633You know what happens when you assume? You become Donkey from Shrek.
>>105592638If the fact you posted here with that question tells me you have no idea what you're doing and your idea sucks and I bet you don't even have the balls to give a high level pitch of your idea which is surefire proof you're a retard who thinks he has a golden million dollar idea.
>>105592647I'm not giving you free ideas, bum.
>>105592657that's what I thought, no you won't make money with adsense, no you won't get magic traffic
so unless
- you have a network of streamers advertising for your
- you have an SEO team and/or a network of websites that can push traffic for you
- or you're do your own CPC campaign (which would make you ineligible for Adsense, arbitrage will get you banned)
You will not make enough money to even hit the payout threshold. But better luck next time kiddo, you're one of millions with a golden idea lmao.
>>105592695I don't even know what got you so upset
>>105592703>I'm going to rape youkill yourself
>>105592730It's in my culture
>>105592734I'll give you a protip, if your idea can be stolen from two sentences on 4chan your idea will be stolen when you publish and someone does it better.
>>105592751I also gain nothing from posting it here.
>hey I've been nothing but rude to you and act like a smug know it all. Let me know what website you want to make Why? What do I stand to gain? Lol
>>105592760niggers like him are the cancer in 4chins, ignore that subhuman
>>105592760Given you have no idea how to monetize it's kind of important lmao. Imagine just asking "can I make money with adsense with my SPA" and expecting real responses when you can't even talk about your SPA. So we circle back to my previous response: you will not make money because you're a newbie who thinks he's going to get rich and typically people like you don't even have unique ideas or even better, your idea is actually trash. If your idea can be easily copied from two sentences here you have a bad idea that will be stolen. If your idea takes 1000 hours to implement, writing two sentences doesn't matter because anyone who steals ideas tend to be incapable of doing such projects and as someone with successful projects, copycats never do it better if you're actually good. But whatever, you're just going to have
>>105592783 dick suckers that wont' actually contribute anything but maybe that's what you really want, is someone to jerk you off.
But you're welcome for the free $500 consulting session, you'll not get anything more valuable today.
>>105592856Jesus that's a lot of text
Anything useful in it?
>>105591783Just make youtube, tiktok, instagram, discord, patreon, etc.'s instructional/informative/reaction videos like a normal person.
When someone wants to see my API documentation what does it mean exactly? I already made a collection with Postman. Give them a link to the published documentation?
>>105590487What kind of game are you making? t. fellow webgame dev
>oh cool a frontend repo
>checks their profile
>hand chin steve job pose
every fucking time
>>105596605Like this?
>>105598932Thank you for saving the thread
>>105547059 (OP)>https://flukeout.github.io/I've been doing webdev for awhile and didn't know about those more advanced css selectors. Very cool exercise.
>>105599147super good shit, if ur a newbie, do this, if ur rusty, do this, if u don't know the new css selectors do this as well 10/10
>>105547059 (OP)It's called vapor because it's vaporware?
>>105599147Pretty cool
>>105599850I dunno why it has that name, but Apple themselves are apparently using it in production (pic related)
>We began rewriting our service using Vapor, a Swift web frameworkhttps://www.swift.org/blog/swift-at-apple-migrating-the-password-monitoring-service-from-java/
>>105599147You only need class selector
>>105592856you've already established this kid is some high school dropout grifter by the way he talks so why not feed him wrong information and waste his time
>>105601464he really wanted da million dollah, keks
Done some work on my PWA today lads.
Feel like such a pussy but I think I'm having bad burn out. I've been entrenched in my own project that's gotten way too big for a single dev to manage but I have no choice right now.
I've been dealing with probably the most complicated feature I've had to implement so far and it took me 10 days just of planning and researching and spitballing with LLMs to come up with a feasible solution but every time I think about sitting down to implement it I get that anxiety in the pit of my stomach and a desire to do literally anything else.
I've already taken basically an entire week off and it still hasn't gotten better. Wtf do I do bros
>>105604065This is why education is so important. This is why proper math and physics education are important for real software engineers. It trains your brain.
>>105604079My bachelor is in mechanical engineering lol
>>105604094by planning do you mean, creating a meticulous step by step task list to get you started?
literally like this
>[ ] open text editor>[ ] load project>[ ] open file 1>[ ] apply fix to file 1>[ ] open file 2etc etc. you might actually start. seems stupid but works for me.
>>105604112Yes, that's what took me 10 days to create. I have a pretty thorough implementation plan but the dread isn't going away. I guess it's because the solution to the problem is unavoidably complicated and I just can't be fucked dealing with it anymore.
>>105604065simplify, ship a subset and ask for feedback?
>>105604404It's not in production yet. A lot of the stress comes from trying to simplify solutions but having to accept that ultimately even the simplest solution is complicated and a pain in the ass. Just sat down to do some work and couldn't get anything done, I'm fucked for the time being it seems lol
Best Frontend Masters courses? I got an account from my job.
anyone here got experience with application firewalls in production, any recommendations?
Does anyone have experience with Youtubes shitty chat?
More importantly do any of you know if it is AT ALL possible to get the user PROFILE from the chat in any way?
You used to be able to slap that dot menu and go straight to the profile but they removed it due to pRiVaCy reasons or some shit.
I'm trying to make a simple moderation system that can detect based on username and the only way I can see to do it right now is a combo of user-profile and name (and membership if they have it)
While you could spoof a name, you can't spoof the same user profile image even if you used the same image.
But still, that's janky as fuck.
good morning sirs
Used to browse this thread very often during covid. Despite the general pessimistic tone you can find here, i was able to get 4 jobs since then. Thanks for all the annons who helped me when i had stupid questions.
My tip is to not give up and keep trying, despite all the AI layoffs headlines, my last job (got in march) was the fastest one since i started. I took me on average 6 months to change a job, this one was like 3. Ofc, my experience is playing a role now, if you have none, just learn to lie.
And btw, are you using AI on your job? Back in 2022 i tried chatgpt, it was bad for code so i never touched it again. Tried last week and it improved a lot. Now im trying to integrate claude and copilot into my workflow.
>>105605072I use it extensively, I don't really write code by hand anymore. I use the whisper model to do voice to text for my prompts. The key is to keep the changes very focused, like 1 level above dictating the actual code you want the LLM in terms of granularity and scope.
>>105595089you can use openapi/swagger to describe with examples the endpoints and what should they expect
google swagger editor and learn how to use that
>>105604926I don't know if this still works, but it might give you the info you need.
https://github.com/ottomated/youtube-websocket
I'm experimenting with a new (old) stack.
>Server Side
Common Lisp
hunchentoot
hunchensocket
easy-routes
spinneret
mito
>Client Side
htmx
Pico CSS
Anonymous posting is allowed.
http://beastie.sdf.org:4200/
>>105606297no idea what almost any of that is
>>105606307I had never heard of most of them until recently too. You'd have to have a little familiarity with Common Lisp to know. You can find most of these libraries mentioned in a very helpful tutorial.
https://web-apps-in-lisp.github.io/
>>105606297I just got websockets with htmx working last night.
https://htmx.org/extensions/ws/
The lisp side could have used more documentation but with the info in the README and digging through some issues, I managed to make it work.
https://github.com/joaotavora/hunchensocket/
https://github.com/joaotavora/hunchensocket/issues/14
^-- This was the first time I used multiple inheritance on purpose, but it kinda magically worked.
>>105591844I just use htmx and put hx-boost on my links. This feels fast while still gracefully degrading when there's no JavaScript. It stays SEO friendly this way too.
https://htmx.org/attributes/hx-boost/
>>105606255Oh yeah i forgot about this.
In fact I remember someone else who just recently made some YT Chat shit to track members. I totally forgot about it, I will need to ask him to see if he found any actual ID related shit.
I remember some script that could also isolate certain accounts in to their own chat window, wonder if it could as well, but it was also old, could be broken now.
The worst part is I've seen this lack of ID CAUSE issues for people before.
I've seen people mod accounts they thought were friends but were random ass people impersonating and a chunk of the chat got banned by the time they realized.
>>105605151>I use it extensively, I don't really write code by hand anymore.Not the guy you're replying to, but that sounds crazy to me. I write code by hand just like I always have but I do ask LLMs if I get stuck with something. Sometimes I get decent answers.
>>105608186Not that anon, but that's how I use LLMs too. I'll ask it questions, and sometimes it gives decent answers that would have taken me hours of manual research to figure out. However, I'll write the code myself. I just want it to help me understand things.
>>105605072>And btw, are you using AI on your job?Our code at work is such an overengineered piece of antipattern shit, all AI models don't know what to do with it and straight bug out all the time lmao
It sucks to deal with, but it keeps me off the street and replaced by AI I guess
>>105609164look for greener pastures, no shame in it if it's to improve your situation
>>105607609>hx-boostI might start using this on static sites. It's like a free speed boost that gracefully degrades.
qq
md5: ee55b99c0670edbf8d994fca7bbf0e4d
๐
>>105609164>>105608295>>105608186sirs that have been my experience too, sometimes AI can help you understand smt 10x faster
i need an example to get smt and AI can generate that in seconds
this week ill start testing them to actually refactor and write shit for me
I use it for js challenges and learning js (more)
t. 6 yoe junior
"Web dev in early 2000s was dominated by PHP, ASP.NET and comprehensive frameworks like Django and Rails. The architectural design of these technologies was db driven and focused on the server. However, as client devices became more powerful and internet speeds increased, there arose an idea of passing large chunks of processing to the browser on the client side. This, along with the rise of module based Javascript based runtimes, frameworks and libraries on both client and server side (Angularjs, React, Node etc) meant that the comprehensive, monolithic architecture of Rails and Django fell out of favor."
Boomer devs, is this an accurate assessment of what happened in web dev over the past 20 years?
>>105613268don't forget mobile apps needing the same data. that also played a role.
>I will learn Vue/Nuxt and I don't give a shit if React dominates the market
>>105613268SPAs make sense. Let's say you want a user to be able to like a post, or something like that. There is no point in loading a whole new HTML document when a user does that. It's more efficient to just send a POST request or whatever, then update the page with JS.
>>105614245That absolutely does not require a SPA. CSR doesn't even require being entirely client rendered. SPA's only make sense when you need different view technologies. A pure website (no mobile app/desktop app/anything else) doesn't really ever benefit from being an SPA. If you have more than just a site then you only benefit from an SPA because it simplifies backend development to be entirely frontend agnostic in that case.
>>105613447Based sane man
>>105613268>Boomer devs, is this an accurate assessment of what happened in web dev over the past 20 years?It's painting with pretty broad brushes, but it's not wrong. I feel like jQuery deserves a mention, because it was winning JS library of that era. Similar to how many libraries try to copy or improve upon React, back then everybody was copying jQuery.
>>105613268No. The accurate assessment of what happened in web dev over the past 20 years is as follows:
>People got more retarded and started doing more and more dumb things which is the reason why they have to keep doing a full 360 every few years
>>105613268You have three types of websites:
- completely static
- dynamic but static per user (blog)
- dynamic and dynamic per user (ecommerce, social media)
Static ones don't render anything on the server.
Dynamic but static are rendered on the server and cached (now static).
Dynamic and dynamic per user should saves a lot more bandwidth being served as a static template and then having dynamic data transmitted via REST.
>>105614577jQuery was necessary to sanely use JS, JS since then incorporated all the features jQuery utility features.
>>105614598For sure. document.querySelectorAll(selctors) would not exist had it not been for jQuery setting an example.
https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll
>>105614284>That absolutely does not require a SPAOkay yeah I guess you're right because you could still have a lot of separate pages and just have JS on each page
>A pure website (no mobile app/desktop app/anything else) doesn't really ever benefit from being an SPAIt benefits if you want your site to feel more like an app, while running in a browser. Think of Spotify's web interface for example. Or Facebook in the browser of course. With today's browsers you can make pretty good SPA web apps.
>>105615327>It benefits if you want your site to feel more like an app, while running in a browser. That's a really good point I didn't think about. There is something about it that feels different. Thank you for this post.
>>105615377nta, spas, purely interactionwise are clearly superior, it is just that they have some drawbacks like seo indexing, and browser history. but imo those should be covered by the fw/native js/browser native capabilities and finally search engines, long story short they should be the default and natively supported
>>105615377There's quite obviously a difference between a site where you navigate between different pages, and an SPA where you can use animations when loading up new views. Use your fucking brain lad.
gg
md5: cc5472cccb8a1230eac2734e2a7fca89
๐
sirs I have one step left in my webdev automation
if the pc im working from, has all major AIs website blocked, cannot install deepseek locally too, how do i avoid retyping my codebase to another machine? My idea:
>use cellphone to screenshot pc1 showing code, class by class
>move pics to pc2
>use some AI to try to OCR all classes from pics
>rebuild the project in pc2
>use claude to refactor
Any tips? This would feel like living in year 3000.
file
md5: f706a4d8d4e3ca76ac20276a23e2cf92
๐
>>105615983You don't need AI to program.
>There's no way to check if a click happens on the resize handle when using {resize:both; overflow: auto;}
Working with javascript has made me suicidal. Holy moly is this shit convoluted and hacky.
>>105580749This is asking for a DNS name. Can I use a free DNS with this (afraid for example)?
I want to do backend but only frontend has jr jobs in my listings
Is the world tired of webdev now?
>>105615983I think there needs to be a license to use computers.
>>105615983your work doesn't trust AI and that is because it can steal their secret sauce, I find it reasonable
>>105547059 (OP)sirs, i am getting back into react development after about a year. i use vite and am wondering if i need to change the default eslint rules and if prettier is still the go to. the airbnb eslint rules seem to be 3 years old on npm. are they still the best, or is there something else? i hate how fast things change in the web dev sphere
>>105619176Just follow the official docs to get started with React. Don't touch the defaults unless you know what you're doing.
>>105619216i was able to set up vite, prettier, and eslint with airbnb about a year ago. is this no longer worth doing? i'm not an incredibly experienced react developer but i've used it before.
>>105619236When setting up a React app following the official docs, it installs eslint for you with sensible defaults.
ESLint docs provide install instructions to get it in your project, including a section about hooking it up with ESLint.
Honestly, RTFM desu.
>>105619410s/ESLint docs/Prettier docs/
Been working as frontend dev for a bit over 5 years and I absolutely hate this.
I thought about studying something on my free time and move away from this shit but as soon as the clock strikes 5 I don't want to see a line of code again.
>>105620613Are you a template.content.cloneNode(true) kind of guy, or a document.createElement("div").append(document.createElement("b").append("(you)")) monkey?
>>105621169>template.content.cloneNode(true)but actually
const e = template.content.cloneNode(true); e.getElementById("msg").textContent = "(you); e.removeAttribute("id"); // template use will create duplicate ids
>>105547059 (OP)Just leaving it here - live with JetBrains for 30 years of PHP
https://www.youtube.com/live/3b0ty1iZ8QM
https://lp.jetbrains.com/phpverse-2025/
>>105621270PHP is alien to me
>>105619176it's built into everything now you don't need to set it up explicitly
>>105620531Just let the thread die already. Holy shit it's been a week now.
How does one do actual typesafe, deserialization of nested lists/objects from json to an actual typed object of a specific class in python? I feel like this must be possible. I have got pylance installed in vscode and it is setup to be a strict as possible and this feels WAY more complicated than what it should be. Robots are not helping either, because all they do is bullshit and thankfully they have fucked up google so freaking much that I cannot find the thing. I'm drowning in bullshit advice.
All I want is to specifiy
>json looks like this shape
>but if it deviates in any way (e.g. more or less keys, unknown tuples, whatever) it is not valid
>>105622059No. Web dev will survive. We will overcome the AI doomers and naysayers. We shall prosper.
>>105622238I don't use Python but if I was doing this with JS/TS then I would just check manually for every required property. I guess that's how you enforce type safety.
>>105622238Look into schema validation.
>>105622497>I don't use Python but if I was doing this with JS/TS then I would just check manually for every required property. I guess that's how you enforce type safety.That's exactly my approach, because I know JS/TS... but python is retarded. You cannot do "isinstance(data, list[YOUR FUCKING TYPES HERE])" but that seems to be the canonical way to do this. JS/TS unironically is not that bad compared to other interpreted languages, because you can actually do meaningful type narrowing if you want to - and the IDE understands it.
>>105623909???
JSON isn't serialized. No other language automatically assumes the strings of JSON are a custom type. And you're in luck anon, because you still have to validate the data because you'd be retarded to just trust a JSON blob without validating the data.
>>105622803>Look into schema validation.Will do, but at first look this seems over the top. I don't know if I can integrate it into the env that this stuff is running. I did not choose to use python after all...
>>105623926No, that is not the point of my rant. The problem is that in python (at least with pylance) - thanks to the COMPLETELY retarded typing system - Any/Unknown/None is ALWAYS an error. So you cannot narrow this down without either going into a less strict mode, having warnings all over the place or adding "ignore" everywhere.
In JS of course JSON.parse returns something that is "any", too. But this "any" is *correct" in the sense that it is not an error - you really have to narrow it down and the IDE allows just that with ease.
Maybe I have gotten brainrot over the years (thanks JS/TS...) but python really seems fucked with regards to this type of stuff.
>>105624050You still have to validate the JSON data integrity. So the process of transforming the JSON to your object(s) also serves as a sanity check, bounds checking and validation, during this process you do the proper object instantiations. I think you're just looking for a shortcut. The best you can do is have a data validation manifest that does this for you. Python is actually making you be a better programmer.
[ "thing" => "isThis" ]
The nice thing about this system is your system doesn't blow up if and when the JSON blob changes.
>>105624161Of course I have to do that. But it's easy in JS:// @ts-check
const data = '[[[0,1],{"b":[[0,1],[2,3]]}],[[0,1],{"b":[[0,1],[2,3]]}]]'
const parsed = JSON.parse(data)
if (!(parsed instanceof Array)) {
console.error('Not an array')
process.exit(1)
}
for (const item of parsed) {
if (!(item instanceof Array)) {
console.error('Expected an array, cannot continue', item)
continue
}
for (const subItem of item) {
if (subItem instanceof Array) {
console.log('Array', subItem)
} else if (typeof subItem == 'object') {
const b = subItem['b']
if (!(b instanceof Array)) {
console.error('Could not handle b:', b)
continue
}
console.log('b', b)
} else {
console.error('Could not handle subItem', subItem)
}
}
}
That's a very simplified example, but the same thing in python import json
import sys
DATA = '[[[0,1],{"b":[[0,1],[2,3]]}],[[0,1],{"b":[[0,1],[2,3]]}]]'
parsed = json.loads(DATA)
if not isinstance(parsed, list):
print('Not an array', file=sys.stderr)
exit(1)
for item in parsed:
^^^^ fails here
Because parsed is list[Unknown] and item is therefore Unknown.
This code is not meant to represent anything at all, I am merely trying to give a (dumb) example. Maybe I am completely off here... is there a simple solution for this problem?
>>105624273DATA = '''
{
"id": 123,
"score": 98.6,
"tags": ["foo", "bar"],
"metadata": {
"source": "sensor",
"active": true
},
"nested": {
"x": 10,
"y": 20
}
}
'''
# Our custom class
class SomeClass:
def __init__(self, x: int, y: int):
if not isinstance(x, int) or not isinstance(y, int):
raise ValueError(f"Invalid types for SomeClass: x={x}, y={y}")
self.x = x
self.y = y
def __repr__(self):
return f"SomeClass(x={self.x}, y={self.y})"
# Parse the JSON
try:
parsed = json.loads(DATA)
except json.JSONDecodeError as e:
print(f"Invalid JSON: {e}", file=sys.stderr)
sys.exit(1)
# Validate top-level dict
if not isinstance(parsed, dict):
print(f"Expected top-level dict, got {type(parsed)}", file=sys.stderr)
sys.exit(1)
# Validate fields
id_val = parsed.get("id")
if not isinstance(id_val, int):
print(f"id is not an int: {id_val}", file=sys.stderr)
score_val = parsed.get("score")
if not isinstance(score_val, (int, float)):
print(f"score is not a number: {score_val}", file=sys.stderr)
Basically this. You have to do this anyways when you're ingesting the blob to fit it into your code, database or system.
Pydandic is a library to do this but as you can see it's not difficult in vanilla Python.
>>105621984it's basically javascript with different syntax
>>105623927> seems over the topIt might be. You end up having to do a special schema definition file and feed it to a library after all. If you think about it though, it's a standard way to specify json shapes between languages, and the libraries usually ensure the typing for you. After a certain point it's less work to do a schema than do manual "homebrew" runtime checking even in TS.
>>105624324That does not solve the issue. Any chance you are an LLM, too? Type of "get" is partially unknown
Type of "get" is "Overload[(key: Unknown, default: None = None, /) -> (Unknown | None), (key: Unknown, default: Unknown, /) -> Unknown, (key: Unknown, default: _T@get, /) -> (Unknown | _T@get)]"
>>105621984There's no reason for PHP anymore now that Astro exists. It's pretty much the perfect build with just html, js, css ssr ssg framework. No need for PHP anymore.
Fuck next.js.
have been doing medium js challenges lately, by chatgpt, damn, so that is indeed my level after all, I struggle
>projectmate hogs all the backend work
>I'm now stuck figuring out how to make this crap look good
I am trash man.
410,757,864,530 DEAD FRONTENDISTS.
>>105629625Pick my cotton nigger
scr
md5: ecf40540044b436f575b1c7469cc40a7
๐
i suck at programming, but this is still useful in a variety of cases.
https://archive.is/E91gB
https://archive.is/8ciji
HTML /cgi-bin/memweb
"JSON" /cgi-bin/mem
(target url was goiing to be https://www.angelfire.com/ct/Jp/ap/ but that isn't working)
>>105628097or you're just a fucking retard and you don't understand you're a fucking retard
you have to ingest your data you fucking retard
json isn't code
your js isn't good, you created an attack vector
no longer helping, you're just a fuck up and you're not going to improve
>>105629625ChatGPT makes mockups
>>105630554>no longer helpingYou cannot stop something you have never started to do.
>your js isn't good, you created an attack vectorBro, that is a really dumb take on example code that was merely written to demonstrate an error in the IDE.
Chatgpt Challenges
Easy
/*
Write a function letterFrequency(str) that takes a string and returns an object with the frequency of each alphabet letter (ignore spaces, numbers, punctuation, and case).
*/
letterFrequency("Hello World!");
// Output: { h: 1, e: 1, l: 3, o: 2, w: 1, r: 1, d: 1 }
Medium
/*
Medium Challenge: Group Words by Anagram
Write a function groupAnagrams(words) that groups words that are anagrams of each other.
Example:
*/
groupAnagrams(["listen", "silent", "enlist", "hello", "ohlle", "world"]);
// Output: [
// ["listen", "silent", "enlist"],
// ["hello", "ohlle"],
// ["world"]
// ]
Let me know if you want the hints that come with it. I've been grinding mediums lately, shit's cash.
ai
md5: 5858ba98d1d2664d7e2341d734b0972e
๐
Are we all fucked lads?
>>105631929>["listen", "silent", "enlist"],why did he meant by this?
>when the guybro novice developer talks his way into leadership and is now code reviewing and making suggestions to make your code shittier but will refuse to strict type or change any of his own awful code.
every developer is immediately looking for a new role.
this general is dead.
We should really change this general to be about the stuff we build and less about learning.
>>105632341yes, but not for that reason. You know how we build gpt-wrappers now? in a few years "gpt" is going to wrap the internet and every service will be offered through MCP.
and yeah, we will only need about 20% of the workforce.
>>105632668>guybro novice developer talks his way into leadershiplmfao, how in the world does that happen?
>>105632693>We should really change this general to be about the stuff we build and less about learning.Surely it can be about both, because both are relevant to web dev. Also we could make this general /wadg/ (web and app dev general) or even /sdg/ (software dev general) but then maybe it would be too similar to /dpt/.
>>105632693>yes, but not for that reason. You know how we build gpt-wrappers now? in a few years "gpt" is going to wrap the internet and every service will be offered through MCP.>and yeah, we will only need about 20% of the workforce.I reckon jobs will still surely exist in the future, even if they're different ones.
If millions of people are made jobless then what will they do? If you don't give them welfare/benefits then they'll start looting and shit. If you DO give them welfare/benefits then that will basically amount to rich people giving free money to ordinary folk, just for ordinary folk to sit around doing nothing productive.
Rich people will probably be willing to give some money away as welfare/benefits (just like they do now) but they will want something in return: labour. They will want ordinary folk to be doing something useful which benefits the rich. It could be picking crops, it could be making weapons, it could be many things.
>>105632700Glazes the CEO and mirrors what he likes. Continually engages him in conversation and is as agreeable as possible, which is an advanced level office politics move, but a common op for a snake.
Continually secretly trashes the code of his fellow developers to the CEO, but not in an obvious way "See this code here, it's...ok, but to make it a lot better I'd do this" kind of speech.
Slowly over the course of several months the CEO starts openly calling him the best developer and talks about how the rest of the team aren't strong developers in developer meetings. Other developers secretly finding new jobs. All of them.
>>105632839forgot picture btw
>>105632839honestly? based af, but being realistic he'll probably find new cattle devs that will fill the gap, probably for cheaper even
>>105632877we know, but me and 2 more already built an app that's a little over 500 monthly recurring after 3 months with nothing but SEO. increasing 25% month over month so far. What he has been doing has been a kick in the butt for a lot of us.
They only hire developers with "business sense". kind of a mistake to put us all in the same room then treat us like that lol
>>105632946I think what you guys have done is right, at the very least you'll put him under pressure and suffering, which is what he wanted, now he can have it
we're pretending to be c1rc in a nuclear bunker where we have unlimited food.
>>105630147There's also /cgi-bin/findurl to check if a URL has been archived before or not.
Can someone please look over the short crap code and tell me what vulnerabilities actually exist?
https://archive.is/2025.06.18-220509/https://arweave.store/riMNMEdtRiRLi9_LlxTXopQvZ9gsKO94TNhv9pNhtnk
It's interesting that Apache(CGI(Bash(html(textarea(curl webpage))))) escapes the webpage's HTML.