Skip to content

Instantly share code, notes, and snippets.

@jkantner
jkantner / index.pug
Created February 23, 2020 20:13
Pure CSS Claw Crane
form.machine
input(type="checkbox",id="fire",name="fire",value="fire")
button.machine__btn(type="button",aria-labelledby="left-btn",ontouchstart="")
span.left-arrow
span.sr(id="left-btn")="Left"
button.machine__btn(type="button",aria-labelledby="right-btn",ontouchstart="")
span.right-arrow
span.sr(id="right-btn")="Right"
button.machine__btn(type="button",aria-labelledby="up-btn",ontouchstart="")
span.up-arrow
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@pbojinov
pbojinov / README.md
Last active July 23, 2024 00:41
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe