Skip to content

Instantly share code, notes, and snippets.

@klickgists
klickgists / TWIG: Date conditional
Created August 15, 2013 18:41
Check dates from entries against current date. For use with #craft CMS.
{% if date >= entry.start|date('Y-m-d') and date < entry.end|date('Y-m-d') %}
<p>current</p>
{% elseif date < entry.start|date('Y-m-d') %}
<p>future</p>
{% elseif date > entry.end|date('Y-m-d') %}
<p>past</p>
{% endif %}
@klickgists
klickgists / SASS: clearfix
Last active December 19, 2015 22:49
SASS clearfix (placeholder)
%clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
// responsive video: http://heliom.ca/blog/posts/responsive-videos;
.responsive-video-div {
margin-bottom: 1em;
> div {
position: relative;
}
iframe {
position: absolute;
top: 0; left: 0;
// Urban Terror configuration
// http://www.urbanterror.info/support/manual/, * marks default value
// # Hardware # //
// Graphic card
seta cg_drawFPS "1" // FPS (frames per second) display (0 off, *1 on)
seta r_colorbits "0" // color depth (0 desktop default, 16, 32*)
seta r_texturebits "0" // texture colors (0 desktop default, 16, 32*)
seta r_texturemode "GL_LINEAR_MIPMAP_LINEAR" // *NEAREST bilin LINEAR triln)
@klickgists
klickgists / gist:5067495
Created March 1, 2013 20:25
jquery: document ready
$(document).ready(function() {
// Handler for .ready() called.
});
@mixin background-gradient($color1, $color2) {
background-image: linear-gradient(bottom, $color1 0%, $color2 100%);
background-image: -o-linear-gradient(bottom, $color1 0%, $color2 100%);
background-image: -moz-linear-gradient(bottom, $color1 0%, $color2 100%);
background-image: -webkit-linear-gradient(bottom, $color1 0%, $color2 100%);
background-image: -ms-linear-gradient(bottom, $color1 0%, $color2 100%);
}
@klickgists
klickgists / gist:4968675
Last active December 13, 2015 20:18
CSS: scrollbar
html::-webkit-scrollbar {
width: 10px;
background: -webkit-gradient(linear,left top,right top,color-stop(0%,rgba(202,202,202,0.07)),color-stop(100%,rgba(229,229,229,0.07)));
background: -webkit-linear-gradient(left,rgba(202,202,202,0.07) 0%,rgba(229,229,229,0.07) 100%);
-webkit-box-shadow: 0 0 1px 0 rgba(0,0,0,.15) inset,0 1px 0 0 #fff;
-moz-box-shadow: 0 0 1px 0 rgba(0,0,0,.15) inset,0 1px 0 0 #fff;
box-shadow: 0 0 1px 0 rgba(0,0,0,.15) inset,0 1px 0 0 #fff;
background-color: #e5e5e5;
}
html::-webkit-scrollbar-thumb {
@klickgists
klickgists / gist:4340783
Created December 19, 2012 21:41
HTML: Blank
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
</body>
</html>
@klickgists
klickgists / gist:4267469
Created December 12, 2012 12:46
Sass: mixin border radius
@mixin border_radius($radius) {
:-webkit-border-radius: $radius;
:-moz-border-radius: $radius;
:border-radius: $radius;
}