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
class Survey extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
questions: [], | |
voteCount: {} | |
} | |
} |
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
/** | |
* Renders an individual question row. Each SurveyRow contains the questions text | |
* and contains a Controls component as one of its children. | |
*/ | |
const SurveyRow = ({text, id, increment, decrement, count}) => { | |
return ( | |
<div className="survey-row"> | |
<div className="text"> | |
<div className="content"> |
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
/** | |
* Displays count and houses the increment and decrement buttons | |
*/ | |
const Controls = ({ id, increment, decrement, count }) => { | |
return ( | |
<div className="controls"> | |
<div data-id={id} className="minus" onClick={e => decrement(e.target.getAttribute("data-id"))}> | |
- | |
</div> |
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 | |
$formData = array("Mike Rosoft", "24637", "[email protected]", "14562342943"); | |
$options = array('valueInputOption' => 'RAW'); | |
$values = [$formData]; | |
$body = new Google_Service_Sheets_ValueRange(['values' => $values]); | |
$append = $this->service->spreadsheets_values->append(SHEET_ID, 'A2:D', $body, $options); |
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 | |
$exampleEmail = '[email protected]'; | |
$result = $this->service->spreadsheets_values->get(SHEET_ID, 'C2:C'); | |
$emails = $result->values; | |
// $emails will be an array, that you can loop through | |
for($i = 0; $i < count($emails); $i++) { | |
if($exampleEmail === $emails[$i][0]) { | |
// The email exists in the spreadsheet already. |
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 BACKEND_URL = 'https://fakeserver.com/api' | |
export function signUpUser(email, password) { | |
return async (dispatch) => { | |
try { | |
const signUp = await axios.post(`${BACKEND_URL}/signup`, { | |
email: email, | |
password: password | |
}) | |
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 someObject = { | |
propertyOne: true, | |
propertyTwo: [] | |
} |
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
{ | |
type: "login" | |
} |
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
function login() { | |
return { | |
type: "login" | |
} | |
} |
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
function loggedIn(state = false, action) { | |
switch(action.type) { | |
case "login": | |
return true; | |
default: | |
return state; | |
} | |
} |