Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Hüneburg michaelhue

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am michaelhue on github.
  • I am michaelhue (https://keybase.io/michaelhue) on keybase.
  • I have a public key ASB3TtVlSTaejcPZ1fcA49ruOQ8a6JcxIJKmYhWXA0Bazgo

To claim this, I am signing this object:

@michaelhue
michaelhue / hookify.js
Last active Feb 21, 2016
Hookify.js – a simple helper for implementing the Hooks pattern.
View hookify.js
/**
* Hookify
*
* A very simple helper for implementing the Hooks pattern in your applications.
*
* @param {Object} obj The object containing hooks.
* @param {Object} ctx Optional context that is applied to hooks. Defaults to the obj.
* @return {Function}
*/
function hookify(obj, ctx) {
@michaelhue
michaelhue / lazyload.js
Last active Feb 16, 2016
JS viewport-aware image lazy loading
View lazyload.js
/**
* Minimal viewport-aware lazy loading for images.
*
* This is a simple vanilla JS script for async image loading
* shortly before the element enters the viewport.
*
* Example:
*
* <div class="img-container" data-ll='{"src": "myimage.jpg", "alt": "My Image"}'>
* <noscript><img src="myimage.jpg" alt="My Image"></noscript>
@michaelhue
michaelhue / page-fieldset.yaml
Last active Aug 29, 2015
Creating re-usable snippets with the var-plugin for Statamic.
View page-fieldset.yaml
fields:
layout:
type: select
instructions: "Select the layout of the page."
options:
image_left: Image left
image_right: Image right
default: image_left
image:
type: file