Details
-
AboutI like using eval :) Web Dev
-
SkillsJS (node/browser) C++ (embedded mostly)
-
Locationnode_modules
Joined devRant on 8/24/2017
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
Fuck accessibility.
No WAIT, before you call me an asshole hear me out.
So when you use CSS grid to create layouts you're supposed to not use the features it has (reordering items) too much, and instead keep the HTML structured the way it's supposed to be read.
When you add a picture of a cat you're supposed to put a alt="Brown cat sitting on a chair" there.
Also you should test for all kinds of sight disabilities and use high contrast colors.
All that for likely <1% of your users.
What would be the alternative? HTML is a markup language, and not supposed to be directly read by humans. Invest the time ONCE for screenreaders to understand CSS positioning and read content in a sensible order. Use image recognition to describe pictures (with selectable levels of detail). Let the browser modify colors on the fly for better readability.
Don't spend time and money to solve a problem 100000 Times that could be solved once.
Fuck accessibility.28 -
fork() can fail: this is important
Ah, fork(). The way processes make more processes. Well, one of them, anyway. It seems I have another story to tell about it.
It can fail. Got that? Are you taking this seriously? You should. fork can fail. Just like malloc, it can fail. Neither of them fail often, but when they do, you can't just ignore it. You have to do something intelligent about it.
People seem to know that fork will return 0 if you're the child and some positive number if you're the parent -- that number is the child's pid. They sock this number away and then use it later.
Guess what happens when you don't test for failure? Yep, that's right, you probably treat "-1" (fork's error result) as a pid.
That's the beginning of the pain. The true pain comes later when it's time to send a signal. Maybe you want to shut down a child process.
Do you kill(pid, signal)? Maybe you do kill(pid, 9).
Do you know what happens when pid is -1? You really should. It's Important. Yes, with a capital I.
...
...
...
Here, I'll paste from the kill(2) man page on my Linux box.
If pid equals -1, then sig is sent to every process for which the calling process has permission to send signals, except for process 1 (init), ...
See that? Killing "pid -1" is equivalent to massacring every other process you are permitted to signal. If you're root, that's probably everything. You live and init lives, but that's it. Everything else is gone gone gone.
Do you have code which manages processes? Have you ever found a machine totally dead except for the text console getty/login (which are respawned by init, naturally) and the process manager? Did you blame the oomkiller in the kernel?
It might not be the guilty party here. Go see if you killed -1.
Unix: just enough potholes and bear traps to keep an entire valley going.
Source: https://rachelbythebay.com/w/2014/...12 -
Broke it. It happened once with normal usage, and i managed to reproduce it by switching excessively fast between notifications and the rant icon. :D3
-
Does anyone know why websockets aren't used far and wide for APIs? I mean not like chat applications, but the typical webapp, say an online shop. For me it seems kinda wasteful to fire separate requests with tiny payloads all the time. I currently use moleculer and socketio for a quite big project with multiple websites and backend containers, and so far, i haven't found a disadvantage.
So what have i missed?12 -
Im going to shove their soapy WordPress plugin up their ass sideways.
Just had to reverse engineer a WordPress plugin communicating with a SOAP API.
Why? Because the stupid fucking retard company thinks "we do not support custom integrations at this time, only plugins for certain CMS and some external providers" IS IN ANY WAY AN OK THING? IT IS NOT.
And i am feeling ashamed for having purchased a WordPress plugin (100 bucks) just for reversing it. My server even has to Report to them as wordpress to get access.
So fucking typical for swiss companies
Edit: also, they state they DO support custom integrations on their main website :/ -
this.onSleep = function() {
for(let i = 0; i < hair.length; i++) {
hair[i].orientation = Math.random();
}
Object.freeze(hair);
}
😐
Whoever thought it was a good idea to put this there, fuck you.15 -
Sometimes, when bugs get a bit out of hand... You have to counter them with better debugging methods 🐥2
-
Today you have the privilege of experiencing a rare look inside one of my servers: https://youtu.be/JcSPnsX-wAA
-
Rant/Question
So I had this friend who has his own company, hosting is part of their business. He gave me a VM to host some websites, test stuff and whatnot. Free. I have quite some important stuff on there (personal, and a few demo sites for clients). No backups of my own, because they do nightly tape backups, and RAID accross physically seperated datacenters. Today, he just shut down my VM - for personal reasons (really personal, nothing to do with his company whatsoever, he hates me lately for something I can't influence). He doesn't say weather or when Ill get the data, and gave me no time to pull it. Can/should I go to the police? I just want my data back, but I don't know if I can do anything as it was free (no contract).
Switzerland, btw.5 -
Someone I work with transfered 7 credit card numbers including cvv and month/year using..... pastebin.
He was not signed in.3 -
I heard I should not allow users to inject arbitrary text into my webpage without sanitizing it. Is it a clean solution to just eval it on the (node) server, and if it runs not post it because it's obviously JS and not just text?
Any opinions on that?11 -
Am I the only one to fix incrementally worse issues with the wrong approach, only to do it right in the end (with minimal research and coding) - being left with 1000 unnecessary workarounds to remove :( happened over the last week or so with a personal Vue project...