Skip to content

Instantly share code, notes, and snippets.

View MrNickBreen's full-sized avatar

Nick Breen MrNickBreen

View GitHub Profile
@MrNickBreen
MrNickBreen / index.html
Created February 6, 2018 22:58
let outside or const inside (http://jsbench.github.io/#907b3e9e370409f9808165c2537b8af6) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>let outside or const inside</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@MrNickBreen
MrNickBreen / swapLayersAndRepositionElements.coffee
Created October 1, 2016 00:40
Swap two Framer layers of different heights and reposition parent layers
# Swap two Framer layers of different heights and reposition parent layers
# Special thanks to Niels http://stackoverflow.com/questions/39240373/framerjs-layer-with-dynamic-height-importing-layers-from-sketch (much cleaner than the original solution I wrote)
# Cowritten by Emily (https://github.com/xymostech) & Nick (https://github.com/mrnickbreen) at Khan Academy (https://github.com/khan)
stackLayers = (layerList, amountToReposition = 0) ->
for layer in layerList
layer.y = layer.y + amountToReposition
resizeParents = (layer, heightDifference) ->
if !layer.parent
return