Skip to content

Instantly share code, notes, and snippets.

@snarf1974
snarf1974 / gist:11197846
Created April 22, 2014 23:26
CSS: Sticky footer 2
* {
margin: 0;
}
html {
height: 100%;
}
html, body {
@snarf1974
snarf1974 / gist:11197922
Created April 22, 2014 23:30
CSS: Responsive image grid
a.image-grid {
float: left;
width: 100%;
height: auto;
margin-bottom: 15px;
text-decoration: none;
}
img.image-grid {
max-width: 100%;
@snarf1974
snarf1974 / gist:11197969
Created April 22, 2014 23:33
JavaScript: Most recent version, jQuery hosted
http://code.jquery.com/jquery-latest.min.js
@snarf1974
snarf1974 / gist:11197998
Created April 22, 2014 23:35
CSS: Sticky footer 1
.container {
margin-bottom: -142px;
min-height: 100%;
/* equal to footer height */
}
.container:after {
content: "";
display: block;
}
@snarf1974
snarf1974 / gist:11198020
Created April 22, 2014 23:36
HTML Template: Client-side redirect (meta refresh)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0;URL=../new-page.htm" />
<title>Redirect to... title of new-page</title>
</head>
<body>
<h1>Re-directing...</h1>
<p>You are being re-directed, if nothing happens, please <a href="../new-page.htm">follow this link</a></p>
@snarf1974
snarf1974 / gist:11198075
Last active August 29, 2015 14:00
CSS: haslayout peekaboo 2
ul li ol li {zoom:normal;} /* added 29/03/10 - to correct ul>li>ol>li counting */
@snarf1974
snarf1974 / gist:11198105
Last active August 29, 2015 14:00
CSS: haslayout peekaboo 1
/* Give hasLayout, to fix peekaboo (and other) bugs */
ul.lightbox,
ul.lightbox li,
ul.lightbox li a,
ul.semtabs,
.box-1col .itemThumbBook li a,
ul li,
.itemThumbBook li,
.box-1col,
.pdfHeader,
@snarf1974
snarf1974 / gist:11198155
Created April 22, 2014 23:43
PHP: <?php echo$_SERVER['PHP_SELF']; ?> makes sure that its valid in HTML Tidy in Firefox
<form action="<?php echo$_SERVER['PHP_SELF']; ?>" method="post" id="contactform">
@snarf1974
snarf1974 / gist:11198226
Created April 22, 2014 23:46
MySQL: Refresh row positions after deleting one
ALTER TABLE tablename AUTO_INCREMENT = 1
@snarf1974
snarf1974 / gist:11198243
Created April 22, 2014 23:47
PHP: How To Test PHP Support In Apache HTTP Server
<?php phpinfo() ?>
http://blog.taragana.com/index.php/archive/how-to-test-php-support-in-apache-http-server/