@tszaboo: so sorry to read about this. I remember your post from a few years back where you moved in hopes of a more suitable job. I sincerely hope you can find a work environment with the right people!
Hm..
Probably how I would handle this is a paper letter mailed to the CEO (or any high-up person that you know will listen).
In the letter you would outline the issue and what dishonest things this person has been doing.
The letter would end in your official resignation with a statement that you enjoy working there and would be very happy to come back but it's either him or you.
Tell them you will give them 1-2 month before you move on.
Then you take some time to do things around the house that you've been putting off, you look for new jobs etc..
But mostly you are waiting for bad stuff to happen at the company, due to you not being there, which proves to them you're more valuable than he is. By quitting you regain control of the situation.
Either they will call, and you get your job back, or they don't and you move on.
Unless you're 100% certain you can fight for your own justice, this is far too confrontational IMO.
Yes it may feel good to "teach them a lesson", but it isn't going to convince anyone but add more fuel to the fire.
Besides, maybe that CEO jumps ships in a few years too, and you meet him/her at an awesome tech startup. What's the point of potentially burning that bridge with such a letter?
I would just hand in a resignation with something along the lines of "my views don't align with the views of the company on how this project/team should be run" and perhaps if you feel like it: "feel that my side of the story is not heard and treatment has been biased". Just say you've found a new job.
Inform them to quit as soon as legal terms of the contract allow, say end of next month. Take all the holiday leave that is still left. Hopefully only work for 5 more days where you basically only commit your local git changes to repository with comments like "TODO:", and write e-mails informing your colleagues (in appropriate time) about your decision.
You may want to inform with your legal insurance on how to do this most efficiently. A company can deny some parts of holiday allowance, but not all since employees in NL are 'always' allowed to take IIRC 2 weeks of holidays in a row. Alternatively they can also become sick days, because don't let the stress of "I must finish everything in time" get grips of you. There are other things in life that matter more like your health. But I cannot give legal advice about this.
I've been in a toxic workplace before, and the biggest regret I had was to continue to work as hard to 'make the best of it', and finish the project that I had ownership of. Let's face it: the work environment sucks, so you're unlikely to change the colleagues and management decisions. Second, that project may be something to be proud of and carry some emotional attachment/investment down the line, but whether you shut the door in 5 days or 5 months from now: you won't be involved in the future of that project down the line.
Sure for a future work reference it may be nice to leave under the best terms, like working on documenting and handing over the project to colleagues. The last week I only worked on documentation of said project. But despite me working for another 2 months on the project, I still had to inform my manager that it was not ready for release yet. Because you know.. engineers and their time estimations.. Nonetheless I regret the most I still trying to live up for the responsibility of this job even after I had handed in my resignation, because like I said.. after you shut the door it's not your problem anymore.
The workplace I worked in had a bully-style manager from another department that asked me to do many things ad-hoc. Many things where he could have given a shorter notice, or where I thought if he know his stuff (he was a highschool dropout, but his dad was up the ass of the big boss..) he would be less dependent. Meanwhile he was gaslighting and downright hurtful behind my back to other colleagues I didn't want to create a scene with this guy, but this also made me feel unheard, unappreciated and annoyed since my actual tasks were frequently disturbed. HR said they saw this guy's "limitations" but in the end this was also my problem.
Well, luckily I had some screw-you money..
2 years down the line, I got a IM whether I was interested in working for them again. All the hints they gave about why were signs to me of what a 'braindrain' does to the company. In a span 3 years most of the development engineers had left (e.g. that braindrain already started when I was still around).
I thanked them sincerely,.