Skip to content

Instantly share code, notes, and snippets.

.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@snarf1974
snarf1974 / target-metro.scss
Last active July 8, 2020 08:51 — forked from tcrammond/target-metro.scss
A sass mixin to write css that targets only IE 10 and IE 11
// Thanks http://philipnewcomer.net/2014/04/target-internet-explorer-10-11-css/
/*
Usage:
@include target-metro {
color: cyan;
}
*/
@mixin target-metro {
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
@snarf1974
snarf1974 / gist:11198315
Created April 22, 2014 23:51
JavaScript: Google Toolbar conflict
$("input.remove_title").attr("title", "");
http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29
@snarf1974
snarf1974 / gist:11198283
Last active February 8, 2016 15:11
PHP: Link to script that forces downloads and caches media files
http://elouai.com/force-download.php
@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/
@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: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: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: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 */