Skip to content

Instantly share code, notes, and snippets.

View fmcat's full-sized avatar

Connor MacDonald fmcat

  • Boston, MA
View GitHub Profile
function switchLayouts(){ var featureToggleString = 'ft_override_enable_pdp_below_the_fold_layout';
var url = new URL(window.location);
var params = params = new URLSearchParams(url.search);
var toggleValue = params.get(featureToggleString);
const isToggleOff = !toggleValue || toggleValue === 'OFF';
params.set(featureToggleString, isToggleOff ? 'ON' : 'OFF');
window.location.search = '?' + params.toString();
}
@fmcat
fmcat / index.html
Last active September 5, 2017 21:08
Memoization Benefits
<div class="container">
<h1>Fibonacci Sequence</h1>
<form>
<div class="form-group">
<label for="number">
Fibonacci sequence number:
</label>
<input type="number" class="form-control" name="number" id="number" min="1" value="1" />
<small class="form-text text-muted">Please enter a number in the fibonacci sequence where n > 0.</small>
</div>