Skip to content

Instantly share code, notes, and snippets.


Jordan Dobson jordandobson

View GitHub Profile
View Test Onboarding
var s = document.createElement("script"); s.setAttribute("src", "");document.body.appendChild(s);
jordandobson / xmlToJson.js
Created Aug 28, 2018 — forked from chinchang/xmlToJson.js
Function to convert XML to JSON
View xmlToJson.js
// Changes XML to JSON
// Modified version from here:
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) { // element
// do attributes
if (xml.attributes.length > 0) {
jordandobson /
Last active Feb 26, 2018
Creating a triangle via Framer Layer
# Project Info
# This info is presented in a widget when you share.
Framer.Info =
title: "Triangle Layer Rebound"
author: "Jordan Dobson"
twitter: "jordandobson"
description: "\n\nThis rebound of \nby Black Ray adds direction checking, allows you to set direction as an option when creating a layer and sets the bounding box of the layer to it's intrinsic size."
jordandobson /
Last active Jul 7, 2017
Get Bounding Layer for Rotated Layer
getBoundingLayerForRotatedLayer = (layer) ->
tr = "topRight"; bl = "bottomLeft"; tl = "topLeft"; br = "bottomRight";
center = x: layer.midX, y: layer.midY
size = w: layer.width, h: layer.height
rotation = layer.rotation
corners =
"#{tr}": x: (size.w/2), y: (size.h/2)
"#{bl}": x: -(size.w/2), y: -(size.h/2)
getRotatedPoint = (p) ->
View Full Height & width background video or image
Set inline width & height.
Video, img alternative natural width & height: 1920 x 1080
21mb video O_O
jordandobson / gist:8498273
Created Jan 18, 2014
helps with touch events
View gist:8498273
<script type="text/javascript">
document.addEventListener('touchmove', function(e){e.preventDefault();}, false);
jordandobson / gist:6747488
Last active Dec 24, 2015
Enable active and hover states on iOS devices to trigger on touch.
View gist:6747488
if( 'ontouchstart' in window ){ document.addEventListener("touchstart", function(){}, false) }
jordandobson / ua-css.js
Created Aug 22, 2013
Add User Agent info to the html tag for CSS
View ua-css.js
var b = document.documentElement;
b.setAttribute('data-ua', navigator.userAgent);
b.setAttribute('data-pf', navigator.platform );
View gist:5911176
/* Loader */
$loader-size = 2.1334em
@keyframes rotate
transform: rotate(0deg)
transform: rotate(360deg)