Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Tracy Floyd http://www.coalescedesign.com

CSS "Popup Window"

// Example of a css based "popup window"

	Click <a onmouseover='this.style.cursor="pointer" ' onfocus='this.blur();' onclick="document.getElementById('PopUp').style.display = 'block' " ><span style="text-decoration: underline;">here</span></a>
	<div id='PopUp' style='display: none; position: absolute; left: 50px; top: 50px; border: solid black 1px; padding: 10px; background-color: rgb(255,255,225); text-align: justify; font-size: 12px; width: 135px;'>
	This is a CSS Popup that can be positioned anywhere you want on the page and can contain any test and images you want.
	<br />
	<div style='text-align: right;'><a onmouseover='this.style.cursor="pointer" ' style='font-size: 12px;' onfocus='this.blur();' onclick="document.getElementById('PopUp').style.display = 'none' " ><span style="text-decoration: underline;">Close</span></a></div>
	</div>

Remove IE scrollbar place holder on non-scrolling pages

// If your page does not need to scroll, in certain situations IE may still show the browser gutter (placeholder for the scrollbar). Remove with this...

html {overflow:auto;}

Disable autocomplete on input fields

// Disable autocomplete on any input field with the "autocomplete" parameter in your input tag

<input name="first_name" type="text" autocomplete="off">

Disable right click

// added <body> to diable the right click.. works on *most* browsers

<body oncontextmenu="return false">

Disable IE image toolbar

// Place in the <head> to get rid of the IE image toolbar

<meta http-equiv="imagetoolbar" content="no">

CSS Alternative to iFrame

// description of your code here

<div style="padding:20px; overflow:auto; border:solid 1px black; width:400px; height:300px;"> 
Content goes here...
<div >

Extract all .tar files in a dir

// Extract all tar files in a dir
for i in *.tar; do echo working on $i; tar xvzf $i ; done

Delete all the .jpg files in all directories below the current

// Delete all the .jpg files in all directories below the current
find /PATH/TO/STARTING/DIRECTORY  -type f -name "*.jpg" -delete

Check Disk Usage on Linux

// Check Disk Usage on Linux
du -sh /PATH/TO/DIRECTORY

Show the last modified date of a page

// Show the last modified date of a page
echo "Last modified: " . date ("F d, Y", getlastmod());