Today I Learned
When using oEmbed on Discord, make sure you include your website domain in the discovery URL. In my <head>
element, I specified my oEmbed support like:
<link type="application/json+oembed" href="/path/to/oembed.json">
But Discord (truth be told, they're all I checked) wasn't including it in their embeds until I changed it to:
<link type="application/json+oembed" href="https://www.example.com/path/to/oembed.json">
So maybe it's not a bad practice to include the site domain in all href
attributes.
Today I learned that print statements cost more than you think. I had a program that needed to perform a calculation...100 million times. I, in my wisdom, had it print what it was doing...100 million times.
When I ran it with print statements, it took over an hour to complete. When I removed the print statements, it took seconds.
It turns out even tiny bits of inefficiency can add up. Who would've guessed?