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
{ | |
"data": [ | |
{ | |
"name": "warmFlame", | |
"direction": "90deg", | |
"colors": ["#ff9a9e", "#fad0c4"], | |
"positions": ["0%", "100%"] | |
}, | |
{ | |
"name": "youngPassion", |
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 Child = ({ createFormHeight, getChildRef }) => ( | |
<CreateForm createFormHeight={createFormHeight}> | |
// getting reference from here | |
<div ref={getChildRef}> | |
// form markup here | |
</div> | |
</CreateForm> | |
); | |
class Parent extends Component { |
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 React from 'react' | |
import { graphql, gql } from 'react-apollo'; | |
import storage from 'store'; | |
const isLoggedIn = ({ children, user }) => { | |
if(user) { | |
return children; | |
} | |
}; |
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
<?php | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* This could easily be something that is added to the admin as a plugin so that users can | |
* add searchable fields in an options table | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; |
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
npx create-react-app my-app | |
cd my-app/ | |
npm start |
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
GET /books/:id |
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 makeSandwich = ({ | |
bread = 'wheat', | |
meat = 'turkey', | |
cheese = 'american', | |
toppings = [] | |
} = {}) => ({ | |
bread, | |
meat, | |
cheese, | |
toppings, |
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
<?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 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 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); |
OlderNewer