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
| // Set base multiplier for use with rem units | |
| html { font-size: 4px } | |
| // Set body back to default size | |
| body { font-size: 4rem } | |
| // Add spacing to elements without worrying if vertical rythm matches the scale | |
| h1 { margin: 0 0 10rem 0 } |
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 Right = v => ({ | |
| chain: f => f(v), | |
| map: f => Right(f(v)), | |
| fold: (f, g) => g(v), | |
| }); | |
| const Left = v => ({ | |
| chain: f => f(v), | |
| map: f => Left(f(v)), | |
| fold: (f, g) => f(v), |
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 transformSibs from 'transform-sibs'; | |
| // Use a curried function to pass more arguments to callback | |
| const removeClass = className => el => el.classList.remove(className); | |
| // get element from DOM | |
| const $item = document.querySelector('.item'); | |
| // Transform all siblings of $item and remove class 'active' | |
| transformSibs($item, removeClass('active')); |
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 transformSibs = (el, callback) => Array | |
| .from(el.parentNode.childNodes) | |
| .filter(child => child.nodeType == 1 && child != el) | |
| .forEach(sibling => { | |
| callback(sibling); | |
| return sibling; | |
| }); |
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 getSibs = (el) => Array | |
| .from(el.parentNode.childNodes) | |
| .filter(child => child.nodeType == 1 && child != el); |
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
| .underline--magical { | |
| background-image: linear-gradient; | |
| background-repeat: none; | |
| background-size: 100% 4px; // how-thick; | |
| background-position: 0 8px; // how-far-down; | |
| } |
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
| <?php | |
| // make sure it is the correct template | |
| if (is_page_template( 'templates/template.php' )) : | |
| $slider_posts = array(); | |
| // check if the repeater field has rows of data | |
| if( have_rows('slider_posts') ) : | |
| // loop through the rows of data | |
| while ( have_rows('slider_posts') ) : the_row(); | |
| // display a sub field value | |
| if (!empty(get_sub_field('the_post'))) : |
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 makeSandwich = ({ | |
| bread = 'wheat', | |
| meat = 'turkey', | |
| cheese = 'american', | |
| toppings = [] | |
| } = {}) => ({ | |
| bread, | |
| meat, | |
| cheese, | |
| toppings, |
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
| GET /books/:id |
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
| npx create-react-app my-app | |
| cd my-app/ | |
| npm start |