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*/
@ajsharma
ajsharma / gist:1169591
Created August 24, 2011 23:37
pseudo-code to have nice slide in and out of twitter logo for twitter category articles
.category-twitter:hover {
background-position: -50px -50px;
-webkit-transition: all 0.5s ease-out;
}
.category-twitter {
background: url(http://a2.twimg.com/a/1314204713/images/logos/twitter_newbird_boxed_blueonwhite.png);
background-repeat: no-repeat;
background-position: -300px -50px;
-webkit-transition: all 0.5s ease-out;
@ajsharma
ajsharma / story-template.html
Created August 23, 2011 22:04
A general layout of what a ui story should look like inside a webapp
<!-- a story is an item that exists in a list that leads into its own. An active story is one that is meant to be interacted with, whereas an inactive story is just for display -->
<article class="story [storyObjectType] [in]active" href="[storyController]/view/[storyId]">
<!-- Optional: Appropriate avatar item for story (user photo, task time etc.) the thing that identifies the story in a quick glance -->
<div class="story-avatar">
<!-- img or time or div or span -->
</div>
<div class="story-content">
<div class="story-content-wrapper">
<header class="story-content-header">