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
| // presentational component | |
| const Greeting = ({ name }) => { | |
| if (!name) { | |
| return <div>Connecting...</div>; | |
| } | |
| return <div>Hi {name}!</div>; | |
| }; | |
| // hoc |
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 validate(phone) { | |
| var regex = /^\+(?:[0-9]?){6,14}[0-9]$/; | |
| if (regex.test(phone)) { | |
| // Valid international phone number | |
| return 'valid' | |
| } else { | |
| return 'invalid' | |
| // Invalid international phone number | |
| } |
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
| <InlineForm> | |
| <Field | |
| id="first_name" | |
| name="first_name" | |
| type="text" | |
| label="First Name *" | |
| className="input-field left" | |
| component={GTextField} | |
| margin="normal" | |
| onChange={props.handleChange} |
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, { Fragment } from 'react'; | |
| import { CopyToClipboard } from 'react-copy-to-clipboard'; | |
| import { TransparentButton } from 'Components/Generics/Buttons'; | |
| import { Wrapper, CopiedText, TextArea, IdeaAreaContainer, TranscriptAreaContainer } from '../styled'; | |
| type Props = { | |
| idea: String, | |
| ideaDetail: Object, | |
| copied: Boolean, | |
| handleCopyText: Function, |
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 Select ({ values, callback, disabled = false, readonly = false, selected }) { | |
| return ( | |
| <select | |
| disabled={disabled} | |
| readOnly={readonly} | |
| onChange={({ target : { value } }) => callback(value)} | |
| > | |
| {values.map(([value, text]) => <option selected={selected === value}value={value}>{text}</option>)} | |
| </select> | |
| ); |
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
| let user = [{ | |
| id: 12, | |
| name: "Richard Johnson" | |
| }, { | |
| id: 21, | |
| name: "David Johnson" | |
| }, { | |
| id: 33, | |
| name: "western Austin" | |
| }, { |
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
| {:transcription_job=>{:transcription_job_name=>"REb6ff296e08085081849b70adea1c9e32.mp3", | |
| :transcription_job_status=>"IN_PROGRESS", | |
| :language_code=>"en-US", :media_sample_rate_hertz=>nil, | |
| :media_format=>"mp3", :media=>{:media_file_uri=>"https://xxssde.s3.us-west-2.amazonaws.com/REb6ff296e080w8508sad1849b70adea1c9e32.mp3"}, | |
| :transcript=>nil, :creation_time=>2019-02-06 12:03:20 +0545, :completion_time=>nil, :failure_reason=>nil, :settings=>nil}} | |
| # RESPONSE GIVEN BY AMAZON TRANSCRIBE | |
| # GET TRANSCRIPTION DETAILS BY JOB ID | |
| # RESPONSE |
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 Ticker extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = {ticker: 0} | |
| this.interval = null | |
| } | |
| tick = () => { | |
| this.reset() | |
| this.interval = setInterval(() => { |
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
| def number | |
| if params[:redirect] | |
| puts 'From redirect pressed 4' | |
| end | |
| user_id = params[:user_id] | |
| digit = params[:Digits] | |
| response = @@twilio.voice_response |
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 initialState = []; | |
| export default function (state = initialState, action) { | |
| const { type } = action; | |
| const reducer = { | |
| [ACTION_CONSTANT]: { | |
| ...state, | |
| // new state value | |
| } | |
| }; | |