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 baseGet from './.internal/baseGet.js' | |
/** | |
* Gets the value at `path` of `object`. If the resolved value is | |
* `undefined`, the `defaultValue` is returned in its place. | |
* | |
* @since 3.7.0 | |
* @category Object | |
* @param {Object} object The object to query. | |
* @param {Array|string} path The path of the property to get. |
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 obj = { | |
a: { | |
b: { | |
c: 1 | |
} | |
}, | |
user: { | |
id: { | |
bbb: 123 | |
}, |
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 | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
use App\User; | |
use App\Question; | |
use App\UploadedFile; | |
class Answer extends Model |
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 styled from 'styled-components'; | |
import { Sprites } from './'; | |
import { COLORS } from '../constants/styles'; | |
const AudioBlock = styled.div` | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
width: 300px; |
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
[ | |
{ | |
"data": [ | |
{ | |
"date": "Friday, 1st December 2017", | |
"day": "1", | |
"fullName": "Demo Master", | |
"phone": null, | |
"serviceName": "Proverka", | |
}, |
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 Room from '../models/Room'; | |
import { isEmpty, shuffle } from 'lodash'; | |
import wordsList from '../public/words'; | |
class RoomController { | |
get(req, res, next) { | |
const { room } = req.params; | |
Room.find({ room }, (err, room) => { | |
if (!err && !isEmpty(room)) { | |
res.json(room); |
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
// config.js | |
const merge = require('lodash').merge; | |
const config = { | |
// Common configuration section | |
sentry: { | |
url: 'https://', | |
}, | |
mongodbUri: 'mongodb://', | |
url: global.hasOwnProperty('location') ? global.location.origin + '/' : '', |
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
// app.js | |
import express from 'express'; | |
import bodyParser from 'body-parser'; | |
import methodOverride from 'method-override'; | |
import session from 'express-session'; | |
import cookieParser from 'cookie-parser'; | |
import errorHandler from 'errorhandler'; | |
import morgan from 'morgan'; | |
import flash from 'connect-flash'; |
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
Object.keys(tags) | |
.sort((a, b) => tags[a] - tags[b]) | |
.reverse() | |
.map((name, i) => ({ [name]: tags[name] })) | |
// before: {a: 3, b: 4, c: 2: d: 1} | |
// after: {b: 4, a: 3, c: 2, d: 1} |