This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Making external embeds play well with our content | |
How we handle fb/twitter/youtube/<insert-a-website-here> embedding in our content to make them play well with the styling of our website. | |
Being a news website, we frequently cite and embed external content mostly Youtube, Twitter and sometimes Facebook. All of these websites provide their embed codes which is fairly easy to use in the sense that you can quickly copy the embed code and paste it in your CMS’s (traditionally Wordpress) HTML editor. | |
Here is an example of some common embed codes for various websites — | |
Problem with pasting embed codes directly is - | |
They eat a lot of user bandwidth with their script and content downloads. | |
The download size increases a lot more if there are multiple embeds in a single post. | |
Embeds like Youtube and Facebook videos even start downloading their initial video files too, even if users have not yet actually played the video. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ---------------------- USABILITY CONFIGURATION ---------------------- | |
" Basic and pretty much needed settings to provide a solid base for | |
" source code editting | |
" don't make vim compatible with vi | |
set nocompatible | |
" turn on syntax highlighting | |
syntax on | |
" and show line numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minElem | |
While pushing x | |
if x < minElem | |
push 2*x - minElem // bcoz its always going to be lesser than x | |
update minElem to x | |
else push x | |
While popping x | |
if x < minElem | |
update minElem to be 2*minElem -y // this gives next minimum |