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
var walk = require('walk'); | |
var fs = require('fs'); | |
var classesOrIds = []; | |
var viewsAndTemplates = [] | |
var walkers = []; | |
var maybeUnusedClassesOrIds = []; | |
var compleWalkersCount = 0; | |
var classesToFileMap = {} | |
// Calback Function every time a walker ends |
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
// pass a rgb/rgba string value into this function i.e. rgb(0,0,0) | |
// and it will return an object of { r: 0, g: 0, b: 0, a: 1 } | |
const parseRGBString = str => { | |
const vals = str.substring(str.indexOf('(') + 1, str.length - 1).split(', '); | |
const colors = { | |
r: parseInt(vals[0], 10), | |
g: parseInt(vals[1], 10), | |
b: parseInt(vals[2], 10), | |
a: parseFloat(vals[3]) |
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
export default async (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array); | |
} | |
}; | |
// example | |
import forEach from '.'; | |
const paths = [...]; |
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
export default time => | |
new Promise(resolve => setTimeout(() => resolve(), time)); | |
// example | |
import delay from '.' | |
const stopAndStart = async () => { | |
console.log('👋'); | |
await delay(1000); | |
console.log('🕐, one second later'); |
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
.chacked-alpha-background { | |
background-image: | |
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, #ccc), color-stop(.25, transparent)), | |
-webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, #ccc), color-stop(.25, transparent)), | |
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, #ccc)), | |
-webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, #ccc)); | |
background-size: 30px 30px; | |
background-position: 0 0, 15px 0, 15px -15px, 0px 15px; | |
background-color: white; | |
} |
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
export default (...fns) => x => fns.reduce((v, f) => f(v), x); |
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
{ | |
"extends": ["airbnb", "prettier", "prettier/react"], | |
"parserOptions": { | |
"sourceType": "module", | |
"allowImportExportEverywhere": true | |
}, | |
"env": { | |
"browser": true, | |
"node": true, | |
"jest": true |
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
import React from 'react'; | |
import { ThemeConsumer } from 'styled-components'; | |
import { mount } from 'enzyme'; | |
import theme from '../../app/theme'; | |
/** | |
* find is object to provide quick short end element selectors | |
*/ | |
export const find = subject => ({ | |
attr: (attr, value, el = '') => subject.find(`${el}[${attr}="${value}"]`), |
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
const rockPaperScissors = usersHand => { | |
let computersHand; | |
let result; | |
// logic | |
return ` | |
You ${result}, computer picked ${computersHand} | |
`; | |
} |
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
const game = { | |
choices: ["rock", "paper", "scissors"], | |
rock: "scissors", | |
paper: "rock", | |
scissors: "paper" | |
}; | |
const play = playerChoice => { | |
if (!game.choices.includes(playerChoice)) { | |
return `Player hasn't selected valid choice`; |
OlderNewer