Skip to content

Instantly share code, notes, and snippets.

@toddaeverett
toddaeverett / gist:3405686
Created August 20, 2012 16:45
Top Navigation using sprites
#topnav {width:960px;height:50px;margin-top:0;background:url(images/topnavBG.jpg);}
#topnav ul{width:759px;height:40px;background:url(images/TNSprites.jpg);margin:0;padding:0;position:relative;}
#topnav ul li {margin:0;padding:0;list-style:none;position:absolute;top:0;background:none;}
#topnav ul li, #topnav ul li a {height:40px;display:block;}
#topnav ul li a {text-indent:-9000px;text-decoration:none;}
#topnav ul li a:focus {-moz-outline-style:none;outline:none;}
#TNhome {left:0; width:71px;}
#TNcourses {left:72px; width:154px;}
#TNgeneralinfo {left:226px; width:157px;}
@toddaeverett
toddaeverett / gist:4514107
Created January 11, 2013 21:29
Character limiter for textarea boxes. Keeps character count from going over a set limit, even if pasting text in. Might need jquery to work. Not sure.
<script language="JavaScript">
function limiter( event, field, limit ) {
backspace = 8;
del = 46;
tab = 9;
if( !event ) event = window.event;
key = ( event.which ? event.which : event.keyCode );
//display_field.innerHTML += String.fromCharCode(key);
field_text = field.value;
/*
Based off of "sweep" by Barragan:
https://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int pos = 90; // variable to store the servo position
int const potPin = A0;