The first brownie recipe appeared in an 1905 edition of The Boston Cooking-School Cook Book, written by Fannie Farmer. As a teacher of the Boston Cooking School, Farmer was credited for introducing the method of using a knife to level off the surface of a cup or spoon for more accurate measurements. In the past, recipes tended to be loosely defined, describing "heaping" and "rounded" measurements. In fact, have you ever watched America's Test Kitchen? That kind of science-based cooking was originally popularized by the influential Boston Cooking School in the 1880s.
The name "brownies" may come from Palmer Cox's comic strips about mischievous mythical elve-like creatures called Brownies. The comic strips were popular from the 1880s to 1910s. And yes, the Girl Scout Brownies names themselves after the Brownies, who were supposed to be helpful spirits.