The expression “smart aleck” for someone too cocky dates back to the 1840s.
New York scam artist Aleck Hoag paid off police to look the other way while he had his wife pose as a prostitute to attract men.
This was done so he could break in on them, revealing that he was the woman’s husband, and demanding money from the frightened man.
When Aleck Hoag stopped paying the police, they arrested the couple and coined “smart aleck” as meaning too clever for your own good.