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 from 'react' | |
import { Launcher } from 'react-chat-window' | |
import io from 'socket.io-client' | |
import config from '../../config.json' | |
import './form-chat-bot.scss' | |
import checkWorkingHours from '../utils/checkWorkingHours' | |
import handleFetch from '../utils/fetch' | |
const socketUrl = 'https://<your-app>.herokuapp.com' | |
let socket |
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 express = require('express') | |
const app = express() | |
const cors = require('cors') | |
const twilio = require('twilio') | |
const socketUtils = require('./utils/socketUtils') | |
const server = require('http').Server(app) | |
const io = require('socket.io')(server) | |
let socketStack = [] |
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
<template> | |
<div id="app"> | |
<Chat | |
iconColorProp="#e6e6e6" | |
messageOutColorProp="#4d9e93" | |
messageInColorProp="#f1f0f0" | |
messageBackgroundColorProp="#ffffff" | |
:messageListProp="messageList" | |
:initOpenProp="initOpen" | |
@onToggleOpen="handleToggleOpen" |
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
// Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
function flattenArray(arr) { | |
if (!Array.isArray(arr)) { | |
return 'Please enter an array' | |
} | |
return arr.reduce((acc, val) => Array.isArray(val) ? acc.concat(flattenArray(val)) : acc.concat(val), []) | |
} | |
// console.log(flattenArray(4)) // will return 'Please enter an array' |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
OlderNewer