A cool nerd; An intellectual with an edge; A person who exhibits book smarts, street smarts and sarcasm all rolled into one; A witty person who knows how to handle themself in the streets, the classroom, workplace, and pretty much any setting they encounter.
That dude must be a nerdy jerk because he's super smart and really cool.
A studious street person can be considered a nerdy jerk.
That nerdy jerk always has something sarcastic and witty to say.
Think: Stringer Bell from The Wire; Stefan Urquelle from Family Matters