Skip to content

u/Mavee

In this archive from Feb 2012 to Jul 2025

18
posts
257
comments
11
media
26k
score
1 saved before deletion

For me, it's always the Full Line completion. That'll run at 100% CPU, all the time, and bring my Macbook from 10 hours of battery time, to at most an hour and a half.

11 points

Tests? Absolutely. Barely scratching 20% of lines I'd reckon, but perhaps 60% of files. No static analysis sadly.

Coverage at my current job is much better, but still no static analysis (but we're seriously thinking of it)

3 points

I used to at my previous job: but that's because too many times people simply didn't check their own code or merges properly, so it was a necessity.

Haven't needed it at my current job for 9 full months so far.

3 points

What values store?

You have a database table named categories. The only columns in there are the primary key, an integer id, and a label, a string. The only way to modify this table is through the PHP code.

The blog posts table will have a column named 'category_id', which has a foreign key constraint to the category table, with ON UPDATE set to RESTRICT, and ON DELETE at to restrict as well

You'll always refer to the category by name, and use the name to get the pk for using it with the blog posts

Say you have categories: travel, food, and misc. You add a blog post, to 'travel', get the primary key for 'travel', so do an INSERT into the blog post table, and set category_id to the pk of the travel category

2 points

What? What do you mean by undesired issues? If you're adding one, you're adding one. Nothing to it. Deleting one? If it'd attached to a blog post, it'll either fail or empty the category id depending on the foreign key, and if it's not attached to any post, it'll get deleted just like that 🤷

2 points

We started off by including our entire database scheme in our project - to deal with autocompleting SQL queries. Was a small step, took some getting used to. Then, my next step was to actually include both the Code Style and Inspections. This was a bit difficult, as different Phpstorm versions format those files differently, leading to some weird commits because people weren't paying attention

Trailing new lines, a newer setting being turned on/off. Next step is to look at PHP CS, or something along those lines, although I myself am a bit hesitant.

I like having guidelines, and I do enforce those during code reviews, but I'm not at all that comfortable having it enforced upon me by a tool, rather than human eyes

1 points

Again -- absolutely right, if not for the simple fact that the web server config (which I tried to find just now, but couldn't) was completely messed up, and didn't make any sense whatsoever.

I was going to say, HTTP_HOST is sort-of client input, but so would the fastcgi_param be, it's just feels a bit more safe.

But, we have a mapping in front of ours. If the subdomain does not exist, just redirect to our main website. We also support different TLD's, and can run the same container/database config for different subdomains, all because we, in Nginx, decide what the SUBDOMAIN param should be, rather than rely on HTTP_HOST.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.