Skip to content

Instantly share code, notes, and snippets.

View JoostKiens's full-sized avatar

Joost Kiens JoostKiens

View GitHub Profile
@JoostKiens
JoostKiens / functions.php
Last active April 22, 2019 09:58
Improve the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes
<?php
/**
* Improves the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes
*
* Author: @joostkiens
* Licensed under the MIT license
*
* @param string $val Empty
* @param array $attr Shortcode attributes
* @param string $content Shortcode content
@JoostKiens
JoostKiens / compass-HiDPI-images.scss
Last active December 10, 2015 23:38
Cross-browser, slimmed-down Compass media query mixin for high-density images.
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
@mixin hr-image($lr-image, $hr-image) {
background-image: url($lr-image);
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(-o-min-device-pixel-ratio: 5/4),
(min-resolution: 120dpi) {
@JoostKiens
JoostKiens / sass-HiDPI-images.scss
Last active December 10, 2015 23:38
Cross-browser, slimmed-down Sass media query mixin for high-density images.
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
@mixin hr-image($image, $width, $height) {
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(-o-min-device-pixel-ratio: 5/4),
(min-resolution: 120dpi) {
background-image: url($image);
@JoostKiens
JoostKiens / blockquote-microdata.html
Last active February 6, 2017 17:50
HTML5 blockquote & citation in figure & figcaption with microdata
<!--
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
@JoostKiens
JoostKiens / graphy.css
Last active June 21, 2016 02:08
Graphing paper like background with CSS3 gradients. Inpired by Graphy on Subtle Patterns
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
body {
background:
linear-gradient(-90deg, rgba(0,0,0,.05) 1px, transparent 1px),
linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px),
linear-gradient(-90deg, rgba(0, 0, 0, .04) 1px, transparent 1px),
linear-gradient(rgba(0,0,0,.04) 1px, transparent 1px),
@JoostKiens
JoostKiens / index.html
Last active December 14, 2015 07:19
A CodePen by Joost Kiens. CSS Page curl - CSS Page curl with one div.
<div class="curl"></div>
<h1>CSS Page Curl</h1>
<p>hover over page curl to resize</p>
@JoostKiens
JoostKiens / dutchLicensePlate.js
Last active August 23, 2017 11:09
Dutch License Plate Functions
define(function () {
'use strict';
function getSidecodeByLicensePlate (licensePlate) {
var sidecodes = [];
var i = 0;
licensePlate = licensePlate.replace(/-/g, '').toUpperCase();
// See http://nl.wikipedia.org/wiki/Nederlands_kenteken#Alle_sidecodes
@JoostKiens
JoostKiens / .editorconfig
Created June 4, 2014 10:09
Editor Configuration file,
# see http://editorconfig.org/ for usage
# and editor support
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
@JoostKiens
JoostKiens / localStorageUtils.js
Last active February 11, 2024 22:34
Simple AMD module with basic localStorage utilities
define(function () {
'use strict';
function removeItem(itemKey) {
localStorage.removeItem(itemKey);
}
function getItem(itemKey) {
return JSON.parse(localStorage.getItem(itemKey));
@JoostKiens
JoostKiens / _media-queries.less
Created June 16, 2014 14:59
Named Media queries, drop in for bootstrap
/**
* Named media queries based on Bootstrap variables
* Usage:
* .module {
* @media @lg { … }
* @media @md, @sm { … }
* @media @md-or-less { … }
* }
*
* @lg-or-more (=> 1200) - - -