A Pen by subpopular on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(Array(100).keys()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Stateless React Component': | |
'prefix': 'srcc' | |
'body': ''' | |
// @flow | |
import React, { PropTypes } from 'react'; | |
import { compose } from 'recompose'; | |
import { withStyles } from '_util/HOCs'; | |
import { FlexBox } from '@madmobilenpm/mmui'; | |
type Props = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Jest Snapshot Test': | |
'prefix': 'jst', | |
'body': ''' | |
import React from 'react'; | |
import renderer from 'react-test-renderer'; | |
import { withAppContext } from '_util/test-utils'; | |
import { default as Component } from '../$1'; | |
const WrappedComponent = withAppContext(Component); |
A Pen by subpopular on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Darek's `functional` bowling score algorithm! | |
function calculateScore(str) { | |
const rolls = str.split(''); | |
return rolls.reduce((data, roll, index) => { | |
let rollScore = calcRoll(roll, data.prevRoll); | |
if (rolls.length - index > 2) { | |
if (/(\/|X)/.test(data.prevRoll)) | |
rollScore *= 2; | |
if (/X/.test(data.prevRoll)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Configurable variables | |
// ⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻⁻ | |
// Absolute height of body text, in pixels | |
$base-font-size: 16px !default; | |
// Absolute height of one line of type, in pixels | |
$base-line-height: 24px !default; | |
// The font unit to use when returning values in rhythm functions |