Skip to content

Instantly share code, notes, and snippets.

@ajsharma
ajsharma / ScrollTop.js
Last active December 10, 2015 10:48 — forked from anonymous/gist:4422788
/**
* Overrides default JQuery.scrollTop to account for top header nav
* @requires JQuery
* @see http://api.jquery.com/scrollTop/
* @see https://github.com/jquery/jquery/blob/master/src/offset.js for scrollTop declaration
**/
(function($) {
var topOffset = 120; // height to account for in scrolling
@ajsharma
ajsharma / gist:3725207
Created September 14, 2012 22:02 — forked from deenseth/gist:1514633
Add Google Calendar Event Bookmarklet
javascript: var s;
/*Figure out the selected text*/
if ( window.getSelection ) {
s = window.getSelection();
} else if ( document.getSelection ) {
s = document.getSelection();
} else {
s = document.selection.createRange().text;
}
/*If there isn't any text selected, get user input*/