Skip to content

Instantly share code, notes, and snippets.

View ajuliano's full-sized avatar

Albert Johansson ajuliano

View GitHub Profile
@ajuliano
ajuliano / gist:1633089
Created January 18, 2012 13:52
HTML5 shiv för lt IE 9
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
<![endif]-->
@ajuliano
ajuliano / gist:1640630
Created January 19, 2012 15:36
Center (vertically and horizontally) an image in div
div.container {
height: X;
line-height: X;
text-align: center;
width: Y;
}
div.container img {
vertical-align: middle;
}
/* see http://haslayout.net/css/No-line-height-Vertical-Center-on-Images-Bug to make it work in lte IE7*/
define( 'WP_POST_REVISIONS', 2 );
@ajuliano
ajuliano / Clearfix
Last active December 11, 2015 05:58
/* Clearfix
*
* For clearing floats like a boss h5bp.com/q
*
*/
.clearfix { *zoom: 1; }
.clearfix:before,
.clearfix:after {
display: table;
content: "";
@ajuliano
ajuliano / Drop Shadoq IE
Last active December 11, 2015 16:08
Drop Shadow för ≤ IE 8
/*
* Drop Shadow för ≤ IE 8 (IE 8 lägger på höjd, därför svår att använda i vissa lägen.)
*
* http://msdn.microsoft.com/en-us/library/ms533086%28VS.85,loband%29.aspx
*/
filter: progid:DXImageTransform.Microsoft.Shadow(color=#DDDDDD,direction=-45) progid:DXImageTransform.Microsoft.Shadow(color=#DDDDDD,direction=45);
@ajuliano
ajuliano / external-link-symbol
Created July 24, 2013 12:55
External Link Symbol
@ajuliano
ajuliano / gist:6297291
Last active December 21, 2015 11:09
Supersmart information to know
Always specify viewport to get the perfect svg: http://www.boogdesign.com/examples/svg/svg-as-image.html
Poor mans nth child selector: http://abouthalf.com/development/poor-mans-nth-child-selector-for-ie-7-and-8/
SVG fallbacks: http://css-tricks.com/svg-fallbacks/
@ajuliano
ajuliano / Clickable svg in a-tag
Last active July 31, 2017 20:13
Make SVG clickable in a-tag and with image fallback
/**
* Make SVG clickable in a-tag and with image fallback (perfect for logotypes)
*
* HTML:
* <a href="http://dystonia-europe.org" target="_blank" class="u--svg-inside">
* <object data="svg-image.svg" type="image/svg+xml"> <img src="fallback-image.png" /> </object>
* </a>
*
*/
@ajuliano
ajuliano / browsehappy-function
Created December 15, 2014 16:18
Surfa Lyckligt (Browsehappy) i WordPress-tema
/**
* Browsehappy
*
* Information om föråldrar webbläsare till besökare med lte IE8.
*
*/
function intervaro_browsehappy() {
$output = '
<!--[if lte IE 8]>
<p class="browsehappy" style="background-color: #333; position: absolute; top: 0; left: 0; right: 0; padding: 12px 24px; margin: 0; color: #FFF;z-index: 1000;">Du använder en <strong>föråldrad</strong> webbläsare. Alla funktioner fungerar inte i din webbläsare. Var vänlig <a href="http://browsehappy.com/" style="color: #FFF;">uppgradera din webbläsare</a> för att förbättra din upplevelse och öka din säkerhet.</p>
@ajuliano
ajuliano / polylang och ACF Options Page
Last active September 19, 2018 14:42
polylang och ACF Options Page
/*
* Få Polylang och ACF Options Page att fungera
*
* http://www.advancedcustomfields.com/resources/multilingual-custom-fields/ (Längst ned på sidan)
*/
add_filter('acf/settings/default_language', function( $language ) {
if ( function_exists( 'pll_current_language' ) ) {