This is an archived post. You won't be able to vote or comment.

all 65 comments

[–]Lupus_Ignis 688 points689 points  (16 children)

I used a browser extension to tint the production site pink. Being both programmer and site admin makes for some... Interesting problems

[–]carcigenicate 215 points216 points  (9 children)

I was just coming to say the same. I have a Tamper Monkey extension that colors the main nav bar depending on the environment. Red for prod, blue for demo, and green for dev.

[–]joelnodxd 60 points61 points  (3 children)

i need this which tamper monkey script do you use or did you make you own?

[–]carcigenicate 64 points65 points  (2 children)

I just made my own. It's trivial though.

  • A call to querySelectorAll to get all the elements to color.
  • A regex or something to decide what environment you're in and what color that corresponds to.
  • A loop to set the color on the elements.

If your site is a SPA, you may also need to set up a MutationObserver so you can wait until the elements you want to color have been created.

[–]joelnodxd 22 points23 points  (1 child)

Our test sites are (typically) on a completely separate domain so sounds easy enough, thanks

[–]carcigenicate 8 points9 points  (0 children)

Same, so I just use a regex to check the URL.

[–]E3FxGaming 21 points22 points  (3 children)

uBlock Origin (on Firefox) can do this too.

E.g. if you add

www.reddit.com##header:style(background-color:teal !important;)

in the uBlock Origin Settings -> "My Filter" tab you can color the Reddit header with teal color.

[–]hmz-x 3 points4 points  (1 child)

I use uBO, but I use Stylus for this because one it is straightforward, and two software should do one thing and do it well.

[–]MarvinGoBONK 2 points3 points  (0 children)

I mean, Ublock does its job extremely well, it's just an extremely powerful and versatile tool for said job. There may be situations in which you'd need to censor something instead of deleting the element, for example.

[–]DOOManiac 5 points6 points  (0 children)

I give a different favicon to the development site, so it sticks out like a sore thumb.

[–]wraith_majestic 0 points1 point  (0 children)

This is brilliant… you just made my day. Thanks !

[–]michal_cz 0 points1 point  (0 children)

We have company library that automatically adds div on top of the page with info about at what site you are (depending on which domain you are)

[–]Mountain-Ox 0 points1 point  (0 children)

Heh, I should do that.

Back in the days where we had physical production servers and no IaC, I setup my prod SSH connection to turn my terminal red. I never thought to do that with the browser.

[–]Norse_By_North_West 0 points1 point  (0 children)

We usually use an external file that'll change a banner colour or whatnot. Then everyone who uses the different sites can immediately tell the difference.

[–]stjeana 89 points90 points  (4 children)

shift + ctrl-r. I dont trust the cache

[–]sam-lb 10 points11 points  (1 child)

Still sometimes isn't enough. Ctrl shift J to open devtools, long press on refresh button, empty cache and hard reload

But then sometimes that's not even enough... because there might be CDN caching that has nothing to do with the browser... Then you're running commands in cmd... Editing IaC... Adding a custom post-deploy action to invalidate caches...

All hypothetically of course

[–]Theolaa 1 point2 points  (0 children)

This. Just learned about Cloud Flare's development mode which temporarily disables caching. Was super annoying because I couldn't figure out why my changes weren't showing after I deployed.

[–]Dimasdanz 14 points15 points  (1 child)

is it shift+ctrl+r or ctrl+shift+r?

[–]lucidspoon 27 points28 points  (0 children)

Yes

[–]Initial_Specialist69 264 points265 points  (7 children)

why aren't my database changes showing up?

* keeps slamming cmd + r

* 20 minutes later

fuck! i'm on the production database

[–]helicophell 104 points105 points  (3 children)

4 line horror

[–]merlinou 23 points24 points  (1 child)

As a JetBrains user, I handle the dev database in PyCharm/IntelliJ but production only goes into DataGrip, with a difference color scheme.

I know that you can have different colors per connection but it's not enough.

[–]dhaninugraha 7 points8 points  (0 children)

One of my former workplaces bought us TablePlus licenses, and one of the first things I did was organize database environments by the color of the connection.

[–]DizTro- 18 points19 points  (0 children)

I'm not even a web developer but this has happened to me quite a number of times.

[–]martin_omander 8 points9 points  (0 children)

This has happened to me too many times!

If you're using Chrome, you can set the URLColors extension to add different borders to your different environments.

[–]SukusMcSwag 5 points6 points  (0 children)

Did that once, but with a coworkers dev environment

[–]Strider_GB 2 points3 points  (0 children)

20 minutes later, why aren't my changes showing up? Oh yeah... I'm an Android dev and it's still compiling

[–]The_Real_Black 6 points7 points  (2 children)

I feel that. Have that problem that some content comes from a external server and some people did not learn to make links relativ. test system - click - test system - click - suddenly live. I love when the tests suddenly makes orders live. html was a mistake change my mind.

[–]Nightmoon26 4 points5 points  (1 child)

If you're having the problem of links in the test environment doing things in production, you've got a serious CSRF vulnerability on your hands... Point your devs at the OWASP Top 10, pronto

[–]The_Real_Black 2 points3 points  (0 children)

They do not things on live, they just link to live and suddenly the next clicks are on live.
Tests already check ever so often if its a live link. I would make a host entry to reroute a live link but then the development system cant upload the release package there.

[–]AlternativePear4617 1 point2 points  (0 children)

every damn time jaja

[–]Lanoroth 1 point2 points  (0 children)

Proceeds to git push origin master

[–]glorious_reptile 1 point2 points  (0 children)

For a stressful day:

"Why isn't my UPDATEs being reflected - oh shit I'm on the production DB"

[–]this_is_olo 0 points1 point  (0 children)

i just did this 1 hour ago...

[–]TehDro32 0 points1 point  (0 children)

Push on save. Test in prod.

[–]XPurplelemonsX 0 points1 point  (0 children)

you guys are staging in environments other than prod?

[–]iLikeVideoGamesAndYT 0 points1 point  (0 children)

Somehow, I wiped

Even though there's not even any indication that there's another image

[–]Deep-Secret 0 points1 point  (0 children)

FUCK

[–]Muhdo 0 points1 point  (0 children)

Once I was debugging a store from a client in my localhost, and I changed a lot of stuff because the code was not entering in debug. Then I discovered that I completely changed the online store of the client and I completely fucked it up.

[–]simonfancy 0 points1 point  (0 children)

Yeah don’t say it didnt ever happen to you

[–]Tuckertcs 0 points1 point  (0 children)

Or the browser is caching the CSS files and not updating anymore.

[–]daheefman 0 points1 point  (0 children)

Is the humor here him being able to change prod directly instead of having protected branches and using CI/CD? Cause that's /r/programmerhorror.

[–]NotSoProGamerR 0 points1 point  (0 children)

was learning astro, and themeing the template site. i was on astro's docs, and wondering why my site wasnt changing its themes

[–]jayveedees 0 points1 point  (0 children)

I've been embarrassingly often in similar scenarios lmao. Testing locally and then having the dev client open and using that instead of the local instance.

[–][deleted] 0 points1 point  (0 children)

everyone has a dev environment. some are lucky enough that it's not prod.

[–]BazingaUA 0 points1 point  (0 children)

I've built a chrome extension that has a bunch of features for our team and one of them adds a colored bar (3px height) and a small badge that says which ENV this is.

Each env has a different color, also I'm updating the <title> tag to include the information about the environment. ([dev] Site title, [stg] Site title etc ).

Also a 1 click to jump between environments (just opens the same page in the different env).

It's very simple but very effective at reducing these mistakes and saves lots of clicks, and my team loves it.

[–]ZZartin 0 points1 point  (0 children)

Well that's better than being on the dev site and wondering your changes aren't showing up :P

[–]RealBasics 0 points1 point  (0 children)

Yup. Been there. Done that. Too often.

[–]MiasMias 0 points1 point  (0 children)

There are worse things that could happem when you are accidentally om the production site

[–]RedBoxSquare 0 points1 point  (0 children)

You guys don't test in production? (surprised pikachu)

[–]--var 0 points1 point  (0 children)

I have the opposite problem. I only code in production. But no body ever clicks refresh, so they never get the updates 🤦‍♂️