Skip to content

Instantly share code, notes, and snippets.

View rpheath's full-sized avatar

Ryan Heath rpheath

View GitHub Profile
@rpheath
rpheath / jquery.infinitescroll.js
Created November 2, 2010 01:48
A jQuery plugin for bi-directional infinite scrolling
// A bi-directional infinite scrolling jQuery plugin
//
// Usage Example:
// $(window).infiniteScroll({ url: window.location.href })
(function($) {
$.scroller = {
// default settings
settings: {
url: null,
@rpheath
rpheath / jquery.infinitescroll.js
Created November 2, 2010 01:46
A jQuery plugin for bi-directional infinite scrolling
(function($) {
$.scroller = {
// default settings
settings: {
url: null,
reversed: true,
triggerAt: 250,
page: 2,
container: $(document),
update: '#scroller'
// Why is this not working in IE!?!?
// (using jQuery 1.4.2 and Rails 2.3.5)
// The issue is that it either: 1) posts as a regular form, ignoring the ajax
// or 2) asks me to download a file
// Yes, I've tried config.action_controller.use_accept_header = false
// in environment.rb and that has no effect on the outcome
// force accept headers
#! /bin/sh
### BEGIN INIT INFO
# Provides: mongodb
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the mongodb data-store
# Description: starts mongodb using start-stop-daemon
// Provides default text in a textbox that disappears when focused
// Note: also toggles an 'active' CSS class so you can change text color
(function($) {
$.fn.friendlyTextBox = function(msg) {
var regex = new RegExp('^' + msg + '$')
$(this).focus(function() {
if ($(this).val().match(regex)) $(this).val('')
$(this).addClass('active')
// global to store a reference
// to the timed autoplay slideshow
var autoplay = null
// Slideshow object
var Slideshow = {
inited: false,
// default settings when
// calling Slideshow.play()
// An unobtrusive Textile editor in jQuery
// Inspired by: http://slateinfo.blogs.wvu.edu/plugins/textile_editor_helper
//
// Usage:
// $(function() {
// $('textarea.textile').textilize();
// )(jQuery);
//
(function($) {
$.textileEditor = function(textarea, options) {
// jQuery plugin
// - will adjust a content area to be at least as
// tall as the sidebar area
// Ex:
// $('#content').adjustHeightWithSidebar()
// $('#content').adjustHeightWithSidebar({sidebar_selector: '#side-bar'})
(function($) {
$.fn.adjustHeightWithSidebar = function(options) {
settings = $.extend({
// tooltip plugin for jQuery
(function($) {
$.fn.tooltip = function(options) {
var options = $.extend({
xOffset: 30,
yOffset: 7,
follow: false
}, options)