This file contains 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
[alias] | |
# git grep | |
todos = grep -i todo -- ':/' | |
fonts = grep -E "(font)(-family)?:" -- "*.css" "*.scss" | |
hooks = grep -w -E "use[A-Z]+[a-zA-Z]*" | |
list-hooks = !git grep -Eho "use[A-Z]+[a-zA-Z]*" | sort | uniq | less | |
search-all = !git rev-list --all | xargs git grep |
This file contains 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 { pipe, split, map, match, head, applySpec, join, addIndex, last, add } from 'ramda'; | |
import { Time } from 'tone'; | |
const indexedMap = addIndex(map); | |
const calcDuration = pipe(split('@'), last); | |
const parseShorthand = pipe( | |
split(','), | |
indexedMap( | |
applySpec({ |
This file contains 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 restaurants = [ | |
{ | |
name: "Dan's Hamburgers", | |
price: 'cheap', | |
cuisine: 'burger', | |
}, | |
{ | |
name: "Austin's Pizza", | |
price: 'moderate', | |
cuisine: 'pizza', |
This file contains 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 currentTime = 15; // 3:00 PM | |
const isOpen = ({hours: {open, close} }) => | |
currentTime > open && currentTime < close; | |
const isFood = ({cuisine}) => cuisine !== 'Coffee'; | |
const toName = ({name}) => name; | |
const openRestaurants = restaurants | |
.filter(isOpen) | |
.filter(isFood) | |
.map(toName) |
This file contains 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 currentTime = 15; // 3:00 PM | |
const toOpenRestaurants = (openRestaurants, restaurant) => { | |
const { | |
name, | |
cuisine, | |
hours: { | |
open, | |
close, | |
} | |
} = restaurant; |
This file contains 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 restaurants = [ | |
{ | |
name: "Pizza Planet", | |
cuisine: 'Pizza', | |
hours: { | |
open: 11, | |
close: 22, | |
}, | |
}, | |
{ |
This file contains 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 cart = [ | |
{ | |
name: 'Waterloo Sparkling Water', | |
quantity: 4, | |
price: 1, | |
}, | |
{ | |
name: 'High Brew Coffee', | |
quantity: 2, | |
price: 2, |
This file contains 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 newEngland = [0,3,6,19,6]; | |
const atlanta = [0,21,7,0,0]; | |
const toScore = (accumulator, value) => accumulator + value; | |
const atlantaScore = atlanta.reduce((accumulator, value) => accumulator + value); | |
const newEnglandScore = newEngland.reduce(toScore); | |
console.log(Math.max(newEnglandScore, atlantaScore)); |
This file contains 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 numbers = [1,2,3,4,5,6,7,8,9]; | |
const divisibleByThree = numbers.filter(currentValue => currentValue % 3 === 0); | |
console.log(divisibleByThree); // [3,6,9]; |
This file contains 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 numbers = [1,2,3,4,5]; | |
const squares = numbers.map(currentValue => currentValue * currentValue); | |
console.log(squares); // [1,4,9,16,25]; |
NewerOlder