A great solution is a comprehensive preference/setting to not automatically expand embeds or even some sort of customizable threshold height to just never show would be great on a user preference level: https://github.com/gitterHQ/gitter/issues/714
Came here to complain about the same thing since I can't take it anymore. Embedding every link to its 640px height limit is very annoying. Everyone I see discussing it hates it. People that encounter it for the first time always apologize for what they did (i.e. pollute the whole screen with their link). The extra polite ones remove the link, try to paste the code to some service they think won't expand, just to be surprised when it does again... chaos all around.
As it was said above, if people want to post small snippets, they just paste them. If they want to post big ones, they use a dedicated service so they won't pollute the whole channel screen. Expanding these links goes precisely against the intention of the link.
I don't know who would want this as a default behavior. Don't know a single person that doesn't curse whenever gitter expands big blocks of code. From this perspective I just don't understand the motivation behind #1217.
Suggestion
Disabling it with a checkbox would be a quick one, but better solution might be adding a [+] button right after the link that will expand its contents below the message. The expanded block should still be capped at 640px, but be scrollable when it overflows, so it's actually useful! The current version hides the rest of the embed, so you are forced to deal with the polluted screen AND have to click the link to see its contents anyway.
In other words: expand on demand.
This behavior could be also extend to code snippets. They should be capped at 200px tops with their bottom border being a thin toggle button, which will expand to the reasonable 640px limit and become scrollable when it overflows. As a bonus, when the block is collapsed, make the whole snippet an expand button.
With code blocks working like this, people might not even need 3rd party services to paste big chunks of code, leading to a more streamlined and comfy UX.