Selflessness means acting with the intent of helping others without harming them, gaining edge over them or taking advantage of them in any way. It is the opposite of self interest. Selflessness is the basis of an ideal society and good technology (while sadly self interest is the basis of our current dystopian capitalist society).
Selflessness is about the intent behind behavior rather than about the result of the behavior; for example being a vegetarian (or even vegan) for ethical reasons (to spare animals of suffering) is selfless while being a vegetarian only because of one's health concerns is not selfless. Similarly if a selfless behavior unpredictably results in harming someone, it is still a selfless behavior as long as the intent behind it was pure. (Note that this does NOT at all advocate the "ends justify the means" philosophy which acts with an intent to hurt someone.)
In the real world absolutely pure selflessness may be very hard to find, partly because such behavior by definition seeks no recognition. Acts of sacrificing one's life for another may a lot of times be seen as selfless, but not always (saving one's child in such way may just serve perpetuating own genes, it can also be done to posthumously increase one's fame etc.). An example of high selflessness may perhaps be so called Langar, a big community kitchen run by Sikhs that prepare and serve free vegetarian food to anyone who comes without differentiating between religious beliefs, skin color, social status, gender etc. Sikhs sometimes also similarly offer a place to stay etc. The mentioned ethical vegetarianism and veganism is another example of selflessness, as well as LRS itself, of course.
Selflessness doesn't mean one seeks no reward, there is practically always at least one reward for a selflessly behaving individual: the good feeling that comes from the selfless action. Selfless acting may also include physical rewards, for example if a programmer dedicates years of his life to developing a free public domain software that will help all people, he himself will get the benefits of using that program. The key thing is that he doesn't use the program to harm others, e.g. by charging money for it or even by using a license that forces others to credit him and so increase his reputation. He sacrificed part of his life purely to increase good in the world for everyone without trying to gain an edge over others.
The latter is important to show that what's many times called selflessness nowadays is only pseudoselflessness, fake selflessness. This includes e.g. all the celebrities who publicly financially support charities; this seems like a nice gesture but it's of course just a PR stunt, the money spent on charities is money invested into promoting oneself, increasing fame, sometimes even tax hacking etc. This also goes for professional firefighters, doctors, FOSS programmers that use licenses with conditions such as attribution etc. This is not saying the behavior of such people is always pure evil, just that it's not really selfless.
Selfless programs and art should be put into the public domain with waivers such as CC0. Using licenses (free or not) that give the programmer some advantage over others (even e.g. attribution) are not selfless.
All content available under CC0 1.0 (public domain). Send comments and corrections to drummyfish at disroot dot org.