Skip to content

Instantly share code, notes, and snippets.

View epicmonkeez's full-sized avatar

Epic Monkeez epicmonkeez

  • Epic Monkeez
  • The Netherlands
View GitHub Profile
/**
* LESS mixin for Nash Image Replacement (http://nicolasgallagher.com/css-image-replacement-with-pseudo-elements/)
*/
.nir(@image, @width: 100%, @height: 100%) {
display: inline-block; overflow: hidden; width: @width; height: @height;
&:before {
content: url(@image);
display: inline-block; line-height: 0; font-size: 0;
}
@epicmonkeez
epicmonkeez / less-ie-rgba-mixin
Created March 13, 2012 19:21 — forked from kilokeith/less-ie-rgba-mixin
LESS IE rgba mixin
.ie_rgba(@hex, @alpha:256){
@newhex: `"#" + (Math.round("@{alpha}" * 256)).toString(16) + "@{hex}"`;
background: transparent;
-ms-filter: ~'"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{newhex},endColorstr=@{newhex})"'; /* IE8 */
filter: ~'progid:DXImageTransform.Microsoft.gradient(startColorstr=@{newhex},endColorstr=@{newhex})'; /* IE6 & 7 */
zoom: 1;
}
@epicmonkeez
epicmonkeez / gist:2030904
Created March 13, 2012 19:21
LESS: Type control mixin
// type
.font-size(@font-size: 16){
@rem: (@font-size / 10);
font-size: @font-size * 1px;
font-size: ~"@{rem}rem"; }
.sans-serif {
font-family : "Helvetica Neue", Helvetica, Arial, sans-serif; }
<h1>Easy Media Queries Shortcodes (w/ LESS) + tester tag</h1>
<section>
<h2>Media Queries Shortcodes <small>using LESS</small></h2>
<p>I've been using this method for writing media queries on a couple of projects now and I'm growing very fond of it. It's pretty simple:</p>
<p>Just set your breakpoints via LESS...</p>
<pre>
// Breakpoints
// ------------------------- Source: http://blog.scur.pl/2012/06/variable-media-queries-less-css/
@epicmonkeez
epicmonkeez / index.html
Created September 20, 2012 14:19
Messing around with 3d transforms and delayed transitions. Colours from http://colour.charlottedann.com/ and icons from http://symbolset.com/
<section class="ss-icon">
<a href="#"><article><span>facebook</span></article></a>
<a href="#"><article><span>twitter</span></article></a>
<a href="#"><article><span>tumblr</span></article></a>
<a href="#"><article><span>pinterest</span></article></a>
<a href="#"><article><span>behance</span></article></a>
<a href="#"><article><span>github</span></article></a>
<a href="#"><article><span>linkedin</span></article></a>
<a href="#"><article><span>dribbble</span></article></a>
<a href="#"><article><span>instagram</span></article></a>
@epicmonkeez
epicmonkeez / Sample output
Last active December 20, 2015 09:09
This little WordPress Gist shows the thumbnail of a post and a link called 'slides' to startup a Lightbox/Slideshow with all the images stored in the post custom field called 'portfolio_slideshow'. - Use within the WordPress Loop. - Used Magicfields plugin to add a field for posts called 'portfolio_slideshow' which can be duplicated. - Use with …
<div class="thumb design development ">
<div class="thumb-img">
<a class="th" href="#" title="Image for the lightbox" rel="bookmark">
<img src="/wp-content/uploads/2013/07/post-thumbnail-image.jpg" class="attachment-wide-thumb wp-post-image" alt="" />
</a>
<div class="caption">
<div>
<span>Image caption</span>
</div>
<div>
@epicmonkeez
epicmonkeez / functions.php
Created August 31, 2013 11:43
Automatically mark as spam comments with a super long url.
<?php
function em_url_spamcheck( $approved , $commentdata ) {
return ( strlen( $commentdata['comment_author_url'] ) > 50 ) ? 'spam' : $approved;
}
add_filter( 'pre_comment_approved', 'em_url_spamcheck', 99, 2 );
?>
@epicmonkeez
epicmonkeez / functions.php
Created August 31, 2013 11:45
Remove the url field from your comment form
<?php
function em_remove_comment_fields($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','em_remove_comment_fields');
?>
@epicmonkeez
epicmonkeez / functions.php
Created August 31, 2013 11:47
Remove url field from the comment form and automatically spam comments with urls
<?php
function em_remove_comment_fields($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','em_remove_comment_fields');
function em_url_spamcheck( $approved , $commentdata ) {
return ( strlen( $commentdata['comment_author_url'] ) > 1 ) ? 'spam' : $approved;
}
@epicmonkeez
epicmonkeez / functions.php
Created August 31, 2013 11:48
Unlink urls in comment text
<?php
remove_filter('comment_text', 'make_clickable', 9);
?>