type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| // 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' |
| <template> | |
| <div id="app"> | |
| <Chat | |
| iconColorProp="#e6e6e6" | |
| messageOutColorProp="#4d9e93" | |
| messageInColorProp="#f1f0f0" | |
| messageBackgroundColorProp="#ffffff" | |
| :messageListProp="messageList" | |
| :initOpenProp="initOpen" | |
| @onToggleOpen="handleToggleOpen" |
| 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 = [] |
| 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 |
| var retinize = require('gulp-retinize'); | |
| gulp.task('retiniizing', function(file) { | |
| /* NOTE: Retinize accepts @4x and @2x resolutions, outputting to @4x, @2x, and @1x. | |
| Overrides may be implemented by manually creating lower resolution copies in the source directory. */ | |
| const retinizeOpts = { | |
| // Your options here. | |
| }; | |
| console.log('Retinizing images...'); |
| var spritesmith = require('gulp.spritesmith'), | |
| gm = require('gm'); | |
| gulp.task('sprite', function () { | |
| console.log('Creating sprite(s)...'); | |
| var spriteData = gulp.src('./path/to/your/image/sprites/*.png') | |
| .pipe(spritesmith({ | |
| // Filter out `-2x` (retina) images to separate spritesheet | |
| // e.g. `github-2x.png`, `twitter-2x.png` | |
| retinaSrcFilter: './path/to/your/image/sprites/*@2x.png', |
| var svgSprite = require('gulp-svg-sprite'); | |
| gulp.task('svg-sprite', function () { | |
| console.log('Creating svg sprite...'); | |
| // Basic configuration example | |
| var config = { | |
| mode: { | |
| css: { | |
| dest: '.', | |
| sprite: './img/sprite.svg', |