I had been working at this company for 13 years and one day, near the end of the day, my boss asked me to write out the process for completing a certain task. It required some Excel knowledge. He told me he was going to give it to one of the BI teams to automate. So I stayed late, past my regular shift to write it up. Afterwards he tested it in his office with me standing there to make sure it worked. It did, so I went home.
Next day started normal but just before lunch, the HR girl called one of my co-workers away, which the rest of us thought was weird. He never returned and someone came by and dropped off an empty box. Then another co-worker was called away. I immediately started backing up personal files on the computer onto a flash drive and sure enough I was called next. We all were let go because of downsizing.
I reached out to my coworkers who weren't let go a few weeks later and found out my boss didnt do something in the process correctly so the whole thing was “broken". It was a critical reporting process that I built.
It wasnt intentional but i think it was a nice bit of karma.