Jquery – A logo fixed position is positioned relative to the browser window.

$(function() {
var offset = $(“#logo”).offset();
var topPadding = 15;
$(window).scroll(function() {
if ($(window).scrollTop() > offset.top) {
$(“#logo”).stop().animate({
marginTop: $(window).scrollTop() – offset.top + topPadding
});
} else {
$(“#logo”).stop().animate({
marginTop: 0
});
};
});
});

Google Chrome to Phone Extension


This extension adds a button to Chrome that lets you seamlessly pushes links, maps, and currently selected text and phone numbers to your Android device. 

You also need to install the Chrome to Phone Android application on your phone. The application can be downloaded from Market (search for 'Chrome to Phone'). Requires a mobile phone running Android 2.2 ("Froyo") or later. 

Note: By installing this extension, you agree to these terms - http://chrome.google.com/extensions/intl/en/gallery_tos.html. The source code for this product is available under the Apache 2.0 license from the Developer website.

Version history:
2.0.0 - First release
2.1.0 - i18n version
2.1.1 - bug fix for es_419
2.1.2 - bug fix for context menu in Chrome 7
2.1.3 - i18n translation fix for ja
2.3.0 - OAuth - login once only
2.3.1 - Fix character encoding issue

Resize Any image While Maintaining Aspect Ratio and Maximum width & Height

It works well for resizing but changing the aspect ratio of the original image squashes the new image.

Example :
Convert a 150*100 image into a 150*150 image.
The extra 50 pixels of the height need to be padded with a white background color.


public void ResizeImage(string OriginalFile, string NewFile, int NewWidth, int MaxHeight, bool OnlyResizeIfWider)
{
    System.Drawing.Image FullsizeImage = System.Drawing.Image.FromFile(OriginalFile);

    // Prevent using images internal thumbnail
    FullsizeImage.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
    FullsizeImage.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);

    if (OnlyResizeIfWider)
    {
        if (FullsizeImage.Width <= NewWidth)
        {
            NewWidth = FullsizeImage.Width;
        }
    }

    int NewHeight = FullsizeImage.Height * NewWidth / FullsizeImage.Width;
    if (NewHeight > MaxHeight)
    {
        // Resize with height instead
        NewWidth = FullsizeImage.Width * MaxHeight / FullsizeImage.Height;
        NewHeight = MaxHeight;
    }

    System.Drawing.Image NewImage = FullsizeImage.GetThumbnailImage(NewWidth, NewHeight, null, IntPtr.Zero);

    // Clear handle to original file so that we can overwrite it if necessary
    FullsizeImage.Dispose();

    // Save resized picture
    NewImage.Save(NewFile);
}

Jquery – A logo fixed position is positioned relative to the browser window.

$(function() {
            var offset = $("#logo").offset();
            var topPadding = 15;
            $(window).scroll(function() {
                if ($(window).scrollTop() > offset.top) {
                    $("#logo").stop().animate({
                        marginTop: $(window).scrollTop() - offset.top + topPadding
                    });
                } else {
                    $("#logo").stop().animate({
                        marginTop: 0
                    });
                };
            });
        });