Skip to content

Instantly share code, notes, and snippets.

View MikeDigitize's full-sized avatar
👋
Howdy

Mike Chadwick MikeDigitize

👋
Howdy
View GitHub Profile
function makeIndex() {
return Math.random().toString(12).substring(2, 12);
}
function Awesome() {
Object.defineProperty(this, 'index', {
writable: false,
configurable: false,
value: makeIndex()
});
@MikeDigitize
MikeDigitize / Web Animation API challenge
Last active April 22, 2018 20:30
Web Animation challenge
// Write a wrapper around the Web Animations API
// takes a HTML element upon creation
// constructor exposes the HTML element, a `keyframe` array of keyframe objects and a `config` object
// the `keyframe` array has a minimum length of 2 (animation start and end), can't start an animation unless satisfied
// each object in the `keyframe` array has a CSS property and value with an optional `offset` property (between 0 - 1, for keyframe %)
// the config object specifies duration, easing and iterations
@MikeDigitize
MikeDigitize / CSS challenge
Created June 26, 2018 20:04
CSS challenge
<style>
.box {
display: flex;
align-items: center;
justify-content: center;
margin: auto;
}
.red {
width: 300px;
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
.ball {
width: 20px;
height: 20px;
border-radius: 50%;
@MikeDigitize
MikeDigitize / Unique string permutations mathematical
Created January 22, 2019 17:40
Get all unique string permutations using non-mathematical recursion vs mathematical recursion
function getNumberOfPermutations(input) {
if (!input.length) {
return 0;
}
let { length } = input;
let dividend = getFactorial(length);
let divisor = 0