Skip to content

Instantly share code, notes, and snippets.

View jordandobson's full-sized avatar
🥽

Jordan Dobson jordandobson

🥽
View GitHub Profile
# DEFAULTS #####################################################################################################
document.body.addEventListener('touchmove', (e) -> e.preventDefault() );
######################################################################################################################
# HELPER METHODS #####################################################################################################
######################################################################################################################
getComponent = (layer, parentLayer, opts) ->
c = layer.copy()
c.visible = true
@jordandobson
jordandobson / - Detect Resize
Last active August 29, 2015 14:06
Detect Resize and OS / Device Type
$(window).bind('resize', function(){
var size = window.getComputedStyle(document.body,':after').getPropertyValue('content');
if (size.indexOf("break2") !=-1){
// Do stuff for breakpoint 2
} else if (size.indexOf("tablet") !=-1){
// Do stuff for tablet
@jordandobson
jordandobson / gist:0aebd3c5f67353714969
Created June 16, 2014 17:37
Clone a html node and make unique
var clone = $(".cloneThisElement").clone().attr("id", "id-"+$.now());
@jordandobson
jordandobson / gist:8498273
Created January 18, 2014 23:34
helps with touch events
<script type="text/javascript">
document.addEventListener('touchmove', function(e){e.preventDefault();}, false);
</script>
@jordandobson
jordandobson / gist:6747488
Last active December 24, 2015 04:59
Enable active and hover states on iOS devices to trigger on touch.
if( 'ontouchstart' in window ){ document.addEventListener("touchstart", function(){}, false) }
@jordandobson
jordandobson / ua-css.js
Created August 22, 2013 00:45
Add User Agent info to the html tag for CSS
var b = document.documentElement;
b.setAttribute('data-ua', navigator.userAgent);
b.setAttribute('data-pf', navigator.platform );
/* Loader */
$loader-size = 2.1334em
@keyframes rotate
0%
transform: rotate(0deg)
100%
transform: rotate(360deg)
@jordandobson
jordandobson / gist:5148914
Last active December 14, 2015 21:09
Recipe example for Trevor. Timer is in secconds... I figured that was better than minutes.
"recipe":{
"overview":{
"title": "Easy Layered Taco Bake",
"total": "35 min",
"prep": "15 min.",
"makes": "6 servings, 1 cup each."
},
"steps": [{
"step": ["Heat oven to 400\u2109.", "Brown meat in large skillet on medium-high heat."],
"pic": "/assets/images/taco-bake/intro.jpg"
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@jordandobson
jordandobson / css.css
Created November 15, 2012 07:46
Update to Ribbon
/* Update to Ribbon *****************************************************************/
#page-content header.affix {
position: fixed;
top: 0px;
}
#page-content header > .panelContainer{
width: 100%;