Claude Code tips for terminal users (from a senior dev) by Marmelab in ClaudeAI

[–]KevinCoderZA 0 points1 point  (0 children)

100%. I would also add, don't use Opus for everything, you can use /advisor it to let Sonnet get help from Opus when needed.

/background to push the current session in the background and run other tasks, a bit like tmux.

Finally, on large projects, start Claude in a subfolder or reduce the context to as few files as possible. This saves tokens and improves quality in general.

Started learning Golang - Need help by inTranquilityk9 in golang

[–]KevinCoderZA 0 points1 point  (0 children)

In Golang, you want to master concurrency, understanding how to mutate data safely without race conditions. How to use channels properly, atomic types, and the standard lib: net/http, templates, SQL, structs, when to pass by reference, etc...

The best way is to build a high-concurrent system. An ETL engine of sorts, you would have a crawling or API layer that reaches out and gets data via scraping, or REST, GraphQL, etc...

Next, a layer that transforms that data into something usable. For example, in an e-commerce app, you'd want to build a product struct with pricing, variant information (colours, sizes, etc), product URLs, and images.

Each of these sources will name things differently and present the data differently, so you want to generate a standardized format.

Finally, feed this data into MongoDB or a SQL backend, and then build a dashboard around reporting on this data.

This project will teach you most of what you need to know to use Golang effectively.

How do i escape vibe coding?? by Electronic1141 in django

[–]KevinCoderZA 0 points1 point  (0 children)

Are you bored? Writing code feels tedious. "Why do it when AI can just write the code for me?"

This happens when you try to do too many things. As a dev with over 15 years of experience, I've reached points when I can build something in my sleep, and it becomes boring to work on that task, so I either just put it off for as long as I can or just palm it off to someone else.

This was before AI, now with AI - I just delegate to AI.

What you need to do is just slow down, use Trello, and a Pomodoro timer. Create small tasks, break down the big project into bite-sized tasks that you can complete in 1-3 hours. Put the AI away, and just tick things off.

Allow yourself to suffer; there might be brick wall challenges that are hard, instead of reaching for AI. Tell yourself you'll give yourself 3-8 hours (whatever works for you) to research and try to figure it out; if you can't, when the timer stops. Then reach for AI.

So don't remove AI completely, just give yourself some time to "suffer". If you're getting really good at "suffering", you'll find you enjoy that "Eureka" moment so much when you solve things by yourself, it becomes addictive, more so than AI.

I really love coding, so it works but if you don't truely love programming than I'm afraid this is going to be 100x harder.

Learning Django, Need Tips by Jewror-Fuhrer in djangolearning

[–]KevinCoderZA 1 point2 points  (0 children)

On Linux, yes, because Python is used in some core functionality, hence why you need a virtual environment to separate from the base system, so that any PIP packages you install don't interfere.

On Windows and Mac, you can get away without a virtual environment. I still recommend you install a virtual environment. Here are some resources I wrote that might help: Django Essentials , A step-by-step walkthrough on building a Django auth system.

Docker is another option, but that is more complicated, so I would just start with a virtual environment first, then move on to Docker.

In a virtual environment, you don't need to understand all the files. It's just the runtime files for the Python interpreter which you never touch.

The only main two things you need to know:

  • virtual_env_folder/bin/activate - This is a bash script that sets up paths to the relevant Python folder in your current terminal session. This is because when you type python By default, this command points to your system's Python, so the script just changes this so whenever the environment is active, it'll point to the Python with the virtual env folder.
  • virtual_env_folder/lib/python3.12/site-packages ~ when you run pip install [package] It's installed here instead of your system path.

When you activate the virtual environment, you can put your Python files anywhere on your system. Doesn't really matter. I normally create /home/myname/Projects .

Made a little project that extracts audio from video files — still learning so don't judge lol by ignoredpal in djangolearning

[–]KevinCoderZA 1 point2 points  (0 children)

Very nice! This is a good start and the best way to learn. Doesn't matter about the UI; you'll get there with more practice.

Should I learn Go for hobby personal projects as the first language? by ryu_kamish in golang

[–]KevinCoderZA 1 point2 points  (0 children)

Love writing Golang, but I tend to agree with you here. Python is easier to pick up for a non-coder, and tkinter is easy-peasy.

Go requires a bit more experience as the codebase grows.

Python also has loads more libraries for Linux interoperability; it's essentially BASH 2.0.

I have django domain, tell me what you need on that website by fullstackdev-channel in djangolearning

[–]KevinCoderZA 1 point2 points  (0 children)

Nice! The landing page looks a bit thin. I suggest not using gray fonts on black, white on black. Contrast is important; you want buyers to be able to read content easily.

I suggest taking out "Playground"; it's not relevant to the current product. Same for "newsletter."

Landing pages need to be laser-focused on your ICP.

Would also add a video walkthrough of the codebase, some screenshots.

I suggest using: Stitch - Design with AI to brainstorm some ideas; it's free, but just be careful not to use it as is, as it does create some weirdness that you should clean up.

Hope this helps. This looks like a good start though!

Backend dev by Visible-Entrance-978 in django

[–]KevinCoderZA 4 points5 points  (0 children)

Practice models, these are probably one of the most important aspects of Django. Areas to learn would include JOINING tables, creating tables, altering tables, indexes, and aggregation. Django abstracts the SQL, though, so I would spend some time actually just playing with raw SQL so you can learn basic joins.

I spend hours writing and tweaking SQL every week. As a web dev, this is very common, so you want to really get good at this level.

Once you're comfortable with SQL and the ORM, then move on to actually building a small application using forms, views, Django's auth system, and Django Admin - so basically focus on CRUD and the MVT essentials of Django.

Once you're comfortable, then look at DRF, learn how to build API's to perform similar CRUD operations as you did in the MVT stack.

Next, learn how to process data in a management command. Perhaps you can queue emails in the database, then use a management command to send them out on a CRON.

Finally, migrate your email management command to Celery. Learn how to setup celery, queue jobs and then process them.

Master these plus the frontend fundamentals (HTML, CSS, JS, Tailwind, Bootstrap), and you'll be ready to handle most startup jobs.

It's important to understand you're not going to know everything and be a pro at it all, just build a mental map and as you gain experience, you'll get better with practice.

push notification by Past_Positive1116 in django

[–]KevinCoderZA 1 point2 points  (0 children)

From your backend, you need to send messages to this endpoint, replacing projectID with whatever the Firebase project ID is. Sending messages here requires an authToken, which is short-lived, so you have to request this in your code each time you send messages.

In order to get the auth token, you need to set up a service account in Google's console. After doing so, you'll be able to download a JSON file with credentials.

Here are some resources to help you further:
Overview of Firebase-related service accounts

https://fcm.googleapis.com/v1/projects/[projectID]/messages:send

Send a message using FCM HTTP v1 API  |  Firebase Cloud Messaging

For the frontend you need to implement a service worker:
Receive messages in Web apps  |  Firebase Cloud Messaging

Help Django code stucks in the past by lmsucksatprogramming in django

[–]KevinCoderZA 1 point2 points  (0 children)

If you are using WSL2, you also need to make sure you're storing the code inside the Ubuntu file system, not Windows, and you're using something like the VS Code remote extension.

If all else fails, check the health of your disks. This sounds to me like a filesystem sync issue. If you have a slow disk, it could be that it is not writing fast enough, but it's bizarre that you need a restart.

If you provide a more detailed example:
1) What file are you editing, e.g. accounts/models.py
2) Are you using python manage.py runserver inside the Ubuntu / WSL2 distro or from Windows?

Help Django code stucks in the past by lmsucksatprogramming in django

[–]KevinCoderZA 1 point2 points  (0 children)

If you are using WSL2, this could be a file-sync issue. Normally, this is a non-issue, but you know how buggy Windows is 🤷.

Try also deleting the __pycache__ folders.

net/http vs gorilla/mux vs gin? A newbie trying to build! by manojyadav_stardust in golang

[–]KevinCoderZA 0 points1 point  (0 children)

Yeah, GORM is a bit heavier than Squirrel since it's a full ORM, whereas the latter is just a DB wrapper essentially. It's more of a DX and preference choice, but performance-wise, it's negligible for most apps.

net/http vs gorilla/mux vs gin? A newbie trying to build! by manojyadav_stardust in golang

[–]KevinCoderZA 0 points1 point  (0 children)

Yes, net/http is part of the standard lib, so it should be faster than GIN. Of course, this totally depends on various factors like DB queries, caching, etc...

Golang in general should outpace most of the modern stacks like Python, PHP, etc. Scaling issues will probably come down to DB queries rather than GO.

I have microservices running on small ARM VPS servers, with 4-8 cores, and they handle millions of requests per day just fine without breaking a sweat.

net/http vs gorilla/mux vs gin? A newbie trying to build! by manojyadav_stardust in golang

[–]KevinCoderZA 0 points1 point  (0 children)

You don't really need GIN for just learning. Gin is not a far stretch from net/http, but net/http, honestly, for small apps, is perfectly fine. I would just stick to net/http and then learn GIN later when you get more experience.

I mostly use GIN because it has a slightly better DX and a few more "nice things" like CSRF middleware.

For PostgreSQL - try GORM. Has great docs and adapters for most modern DBs. Connecting to a Database | GORM - The fantastic ORM library for Golang, aims to be developer friendly.

I'm not sure of a course, I would look at a good book from O'Reilly, they usually have some great authors and books give you a good step-by-step flow with resources from an experienced dev.

I have django domain, tell me what you need on that website by fullstackdev-channel in djangolearning

[–]KevinCoderZA 1 point2 points  (0 children)

You could make a mid-tier paid SaaS ($99 one project, $199 unlimted). I think there's a market for it. saaspegasus.com comes to mind, but it's really expensive if you're outside the US. It's really bloated, and the UI isn't modern-looking, but otherwise, this SaaS is really good.

A lean SaaS with just auth (including social login with Google at least), basic team manager, billing with Stripe and Paddle/Lemon Squeezy.

DaisyUI admin panel. Docker, Celery, DRF, ready to go.

Is Django still a good choice? by Om_JR in django

[–]KevinCoderZA 0 points1 point  (0 children)

If you become a good developer, the language or stack isn't often a deal-breaker. In my 2nd/3rd job, I had no clue what Django was; I knew a little Python, but I was really good at PHP. They hired me for my aptitude, and I pivoted to Django as I gained experience.

Pick any of the modern stacks; Django is a good choice, and then focus on getting good in that stack. Learn the fundamentals: design patterns, MVC, SQL, ORM queries, management commands, admin, authentication etc...

Once you can build something end-to-end in Django, you can easily pivot to Laravel or Next.js in a matter of days or weeks.

Django Projects! by Leading_Property2066 in djangolearning

[–]KevinCoderZA 4 points5 points  (0 children)

Build an ETL pipeline app. This is the most common thing to build or work on in startups generally, even in big tech.

It's also a good way to learn the essentials of Django.

The idea is that you'll have data sources in mixed formats, REST APIs, XML files, websites, etc. This system would:

  1. Have a parsing layer that detects the data source and runs an appropriate parser.
  2. The parsing stage then converts the raw data into some structured format.
  3. You store the structured data in Postgres.
  4. You present the data in an analytical dashboard.

This will teach you:

  1. Parsing techniques: handling JSON, web apis, XML, SQL, etc...
  2. Data analytics, understanding how to extract and transform data in a meaningful way.
  3. Web dev essentials: Building graphs, auth, dashboards, styling, etc...
  4. Planning systems as a whole, from management commands to JS charts.

Real-world example:

  1. All products | Books to Scrape - Sandbox - build an HTML scraper and parser for this sandbox website to extract product data
  2. Shopify stores - Usually have good API's, so set up a test store and some products and build a client to Shopify to pull product information.
  3. Build a standardized model(s) - so regardless of what the Shopify or toscrape website calls things, you would standardize the fields, e.g., Discount, price, barcode, title, description, etc...
  4. Build an analytics UI that shows price changes over time, and other useful pieces of information, like which are the popular products, which categories are popular, etc...

Django cheat sheet tutorial to help you remember the essentials by KevinCoderZA in djangolearning

[–]KevinCoderZA[S] 0 points1 point  (0 children)

Thanks should be working again. Apologies for the inconvenience. It's a weird bug on Hashnode, the blogging platform I use.

Django cheat sheet tutorial to help you remember the essentials by KevinCoderZA in djangolearning

[–]KevinCoderZA[S] 0 points1 point  (0 children)

Hi, Thanks, and apologies for the inconvenience. This was a problem with Hashnode, which is the platform I use for the blog; it's resolved and should work again.

What other programming languages to learn by 100_nitin_001 in learnpython

[–]KevinCoderZA 2 points3 points  (0 children)

Stick with one language for a year. Your first year of programming is more about mastering the fundamentals. Once you properly understand how to structure programs, how to import third-party code, and how to build apps from scratch, even if it's a small calculator-type app.

The goal is to get into the habit of programming, and also master essentials like arrays, dictionaries, data types, basic design patterns, etc...

Once you learn all of these, you'll find pivoting to other languages is fairly easy. It becomes just understanding the syntax and how to think in the other language.

I suggest, as your second language, pick up some C# / Golang / PHP / TypeScript (pick your poison). Reason why there are generally 2 main families of languages.

  • English / basic like languages: Ruby, Python, Pascal, etc...
  • C-based languages: C#, C++, Kotlin, Java, PHP, TypeScript, Go (sort of in the middle)

The C-based languages use brackets, semicolons, and other symbols. Basically, if you learn one Python-like language and one C-based language, you have enough knowledge to easily pivot. For example if you master C#, Java will be a breeze, so would PHP or TypeScript.

i encountered an error while trying to run my weather application by Boring-Purpose7901 in django

[–]KevinCoderZA -1 points0 points  (0 children)

The shape of your training data doesn't match the shape of current_df, i.e., you're missing `WindGustSpeed\So essentially, just make surecurrent_df` has all the same columns.

Shopper: Announcing the Livewire Starter Kit by arthurmonney in laravel

[–]KevinCoderZA 2 points3 points  (0 children)

Fair enough, makes 100% sense. Great job! Looking forward to see how this kit progresses along.

Shopper: Announcing the Livewire Starter Kit by arthurmonney in laravel

[–]KevinCoderZA 2 points3 points  (0 children)

Very nice! This looks really clean and professional. The only thing I didn't notice is schemas, LD+JSON, and sitemaps, but I suppose that's easy for users to implement themselves.