1. For memory: it's all about the strange. The brain is exceptionally good at remembering strange and weird events. So all the articles you read where something odd happens you'll probably be able to recall with photographic accuracy. One way to take advantage of this is to weave strange narratives throughout factual information you want to recall. It would probably be best if someone else did this for you so you'll know it's not fake and you'll automatically hang on to the story as an anchor point. The best part about this technique is it requires no effort. You will automatically prioritise remembering the information. No additional effort needed.
2. For concentration: it's paramount you consider your motives. Since this is hacker news the main reason people might want to optimise concentration is to work harder. They fear that they're 'not getting enough done.' Maybe in severe cases they won't be able to start work at all. The trouble is: the harder you force yourself to work, the less time you have to recover, and the sloppier your work becomes. Believe it or not -- the ones who are able to achieve exceptional output are also the ones who aren't overly-attached. They can deliver whether things are going good or not because they're always emotionally in a good place. When you care for yourself better you really can do amazing things. Software engineering can be very demanding so I do think this is the right approach for most people.