Actually, it can (and is routinely) done.
https://github.com/brockwhittaker/Detect-Adblockers
The techniques used by the project to which you've linked can be trivially worked around by detecting the script itself and either not running it or telling it what it wants to hear. (Come on: an iframe? You really don't think a browser extension could lie about that? I expected at least some kind of server-client traffic correlation for a serious ad-blocker-blocker attempt.)
That is unfortunately not the case in all situations now (e.g. mobile devices).
Now guess if I block ads?