Skip to content

Instantly share code, notes, and snippets.

View kellishaver's full-sized avatar

Kelli Shaver kellishaver

View GitHub Profile
@kellishaver
kellishaver / dropdown_menu.js
Created January 4, 2010 23:50
dead-simple dropdown menus with jquery
jQuery.fn.dropdown = function() {
var menu = $(this);
var ddm = 0;
menu.find('li ul').hide();
menu.find('li').bind('mouseover', function() {
ddm = $(this).find('ul li').unbind('mouseout');
ddm = $(this).find('ul').stop().show();
ddm.prev().addClass('on');
}).bind('mouseout', function() {
if(ddm) {
@kellishaver
kellishaver / get inverse hex
Created December 3, 2009 16:31
feed it a hex code and it returns the inverse
function invert_color(color) {
color = color.replace('#', '');
r = color.substr(0,2);
g = color.substr(2,2);
b = color.substr(4,2);
inverted_r = 255 - parseInt(r,16);
inverted_g = 255 - parseInt(g,16);
inverted_b = 255 - parseInt(b,16);
@kellishaver
kellishaver / VPS setup
Created July 5, 2009 17:15
basic rails stack setup - OUTDATED
#!/bin/bash
RUBYGEMS_URL="http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz"
RUBYGEMS_FOLDER="rubygems-1.3.1"
RUBYGEMS_EXT="tgz"
apt-get update
apt-get install build-essential ruby ruby1.8-dev wget vim apache2 libopenssl-ruby apache2-prefork-dev rdoc git-core
apt-get install sqlite3 libsqlite3-dev
apt-get install imagemagick
@kellishaver
kellishaver / slideshow
Created February 17, 2009 06:45
A very simple jQuery slideshow.
// -----------------------------------------------------------------
// A very simple jQuery slideshow. It requires a little more work
// on the part of the user, but this keeps the transition code tiny.
// -----------------------------------------------------------------
// CSS
// -----------------------------------------------------------------
#slideshow { width:200px; height:200px; }
.hidden { display:none; }
// -----------------------------------------------------------------