Skip to content

Instantly share code, notes, and snippets.

@Quinten
Quinten / help-icon.css
Created February 20, 2014 09:52
Help icon with tooltip
.info-icon {
display: inline-block;
position: relative;
width: 16px;
height: 16px;
margin-bottom: .5em;
}
.info-icon-button {
font-family: serif;
@Quinten
Quinten / mobpop.css
Created April 3, 2014 08:30
popup mobile/responsive
#area {
position: relative;
}
.popup {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
@Quinten
Quinten / meter.css
Created April 10, 2014 07:35
display equally distributed (needs editing)
.meter ul.markers {
list-style: none;
padding: 0;
margin: 0;
text-align: justify;
height: 1em;
line-height: 1em;
}
.meter ul.markers:after {
@Quinten
Quinten / backgroundsize-cover.css
Created April 22, 2014 12:11
background-size cover in IE (for elements with scalable backgrounds)
#selector {
background-image: url(./path/relative/to/cssfile/to/image.png);
background-size: cover;
}
.ie #selector {
background-image: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/path/relative/to/document/or/absolute/path/to/image.png',sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/path/relative/to/document/or/absolute/path/to/image.png',sizingMethod='scale')";
}
@Quinten
Quinten / play-icon.css
Last active August 29, 2015 14:04
play-icon in css
.youtube-thumb {
height: 100px;
line-height: 100px;
background: #fff;
position: relative;
}
.youtube-thumb:before {
content: " ";
display: block;
@Quinten
Quinten / cookie.js
Last active August 29, 2015 14:18
fast js cookies
@Quinten
Quinten / gist:791e49ba46423fb6cbb5
Created June 9, 2015 14:00
smooth scroll script
var scrollVal = 0;
setInterval(function () {
scrollVal += 3;
jQuery('body').scrollTop(scrollVal);
},17);
@Quinten
Quinten / transform_date.php
Created June 15, 2015 09:06
transform a date
$originalDate = "2010-03-21";
$newDate = date("d-m-Y", strtotime($originalDate));
@Quinten
Quinten / inline-block-IE
Created April 21, 2011 12:46
inline-block in IE (finally)
li {
display: -moz-inline-stack; /* Firefox 2 */
display: inline-block;
zoom: 1; /* IE hack to trigger hasLayout */
*display: inline; /* IE hack to achieve inline-block behavior */
}
@Quinten
Quinten / object_property_sort
Created May 9, 2011 15:00
sort an array of objects on the values of certain properties in mysql style
// sort an array of objects on the values of certain properties
// Usage: $obj_list = object_property_sort($obj_list, "title ASC");
function object_property_sort($obj_arr, $order_by) {
$sort = explode(" ", $order_by);
$property = $sort[0];
$dir = ($sort[1] == "ASC") ? SORT_ASC : SORT_DESC;
$sort_on_arr = array();
foreach($obj_arr as $key => $object)
$to_sort_arr[(string)$key] = $object->$property;