Skip to content

Instantly share code, notes, and snippets.

@Frique
Frique / gist:b94f285ea6014398bbf6
Created February 11, 2015 07:41
Aspect ratio mixin
/* Source: http://css-tricks.com/snippets/sass/maintain-aspect-ratio-mixin/ */
@mixin aspect-ratio($width, $height) {
position: relative;
&:before {
display: block;
content: "";
width: 100%;
padding-top: ($height / $width) * 100%;
}
@Frique
Frique / functions.php
Last active August 29, 2015 14:23
Prevent WP update checking
// Tell WP everything is up to date
add_filter( 'pre_site_transient_update_core', 'le_prevent_update_checks' );
add_filter( 'pre_site_transient_update_plugins', 'le_prevent_update_checks' );
add_filter( 'pre_site_transient_update_themes', 'le_prevent_update_checks' );
function le_prevent_update_checks() {
global $wp_version;
return (object) array(
'last_checked' => time(),
@Frique
Frique / example_fancybox-gallery.html
Created October 31, 2015 05:16
Etalage example: fancybox with gallery
@Frique
Frique / CSS: opacity.css
Last active December 14, 2015 19:59
CSS: opacity
zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
filter: alpha(opacity=50);
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
@Frique
Frique / CSS: box-sizing: border-box.css
Created March 12, 2013 07:50
CSS: box-sizing: border-box
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
@Frique
Frique / CSS: border opacity.css
Last active December 14, 2015 19:59
CSS: border opacity
border: 20px solid rgba(0,0,0, 0.3);
-moz-background-clip: padding;
-webkit-background-clip: padding;
background-clip: padding-box;
@Frique
Frique / CSS: Input placeholder styling.css
Last active December 14, 2015 19:59
CSS: Input placeholder styling
::-webkit-input-placeholder{
font-style: italic;
}
:-moz-placeholder{
font-style: italic;
}
@Frique
Frique / CSS: Transitions.css
Created March 12, 2013 07:55
CSS: Transitions
-webkit-transition: all 0.4s ease-out;
-moz-transition: all 0.4s ease-out;
-o-transition: all 0.4s ease-out;
-ms-transition: all 0.4s ease-out;
transition: all 0.4s ease-out;
@Frique
Frique / CSS: Transform: Rotate.css
Created March 12, 2013 07:53
CSS: Transform: Rotate
-ms-transform: rotate(-1deg);
-moz-transform: rotate(-1deg);
-webkit-transform: rotate(-1deg);
-o-transform: rotate(-1deg);
transform: rotate(-1deg);
@Frique
Frique / keep-focus.js
Last active December 19, 2015 15:38 — forked from drublic/keep-focus.js
var tabbableElements = 'a[href], area[href], input:not([disabled]),' +
'select:not([disabled]), textarea:not([disabled]),' +
'button:not([disabled]), iframe, object, embed, *[tabindex],' +
'*[contenteditable]';
function keepFocus($context){
var $allTabbableElements = $context.find(tabbableElements);
var $firstTabbableElement = $allTabbableElements.first();
var $lastTabbableElement = $allTabbableElements.last();
$context.on('keydown', function(event){