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
| <a href="tel:1-234-567-8910" aria-label="Телефон поддержки" target="_blank" rel="noopener noreferrer">+1 (234) 567-89-10</a> |
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
| <video class=“mainSlideBackgroundVideo”preload=“auto” playsinline autoplay muted loop> | |
| <source src="https://archive.org/download/WebmVp8Vorbis/webmvp8_512kb.mp4" type="video/mp4"> | |
| <source src="https://archive.org/download/WebmVp8Vorbis/webmvp8.ogv" type="video/ogg"> | |
| <source src="https://archive.org/download/WebmVp8Vorbis/webmvp8.webm" type="video/webm"> | |
| </video> |
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
| export class EventObserver { | |
| constructor() { | |
| this.observers = [] | |
| } | |
| subscribe(fn) { | |
| this.observers.push(fn) | |
| } | |
| unsubscribe(fn) { |
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 output = getQuestions.map(async groupQuestions => { | |
| // Получим описание группы | |
| const { title } = getGroupQuestions.find(groupItem => _.isEqual(groupItem._id, groupQuestions._id)) | |
| // Получим блоки для вопроса. | |
| const getQuestionsOutput = groupQuestions.entres.map(async questions => { | |
| return { ...questions, blocks: await Block.find({ _id: { $in: questions.blocks } }) } | |
| }) | |
| return { | |
| title: title, |
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
| // N first elements from array | |
| const ar = [1,2,3,4,5,6,7] | |
| const arAfter = ar.filter((i, index) => (index < 3)) | |
| // split array to few array wit N elements | |
| const foldm = (r, j) => { | |
| return r.reduce((a, b, i, g) => (!(i % j) ? a.concat([g.slice(i, i + j)]) : a), []) | |
| } |
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
| // original gist | |
| const shuffleArray = arr => arr.sort(() => Math.random() - 0.5); | |
| // fully random by @BetonMAN | |
| const shuffleArray = arr => ( | |
| arr | |
| .map(a => [Math.random(), a]) | |
| .sort((a, b) => a[0] - b[0]) | |
| .map(a => a[1]); | |
| ); |
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 somevar = { a: 'foo', b: 'bar' }[switchval] || 'default'; | |
| // | |
| let switchval = 3; | |
| let somevar = ['a','b'][switchval] || 'default'; |
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 re = /^(\+7|7|8)?[\s\-]?\(?[489][0-9]{2}\)?[\s\-]?[0-9]{3}[\s\-]?[0-9]{2}[\s\-]?[0-9]{2}$/gm |
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 rewireReactHotLoader = require("react-app-rewire-hot-loader") | |
| const rewired = require("react-app-rewired") | |
| const rupture = require("rupture") | |
| const { injectBabelPlugin } = require("react-app-rewired") | |
| function contailCSSLoader(obj) { | |
| const reg = /css-loader/ | |
| if (typeof obj === "string") { | |
| return reg.test(obj) |
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 { buildFavicon, buildInjectFavicon } from './tools/build-favicon' | |
| import { dest, lastRun, parallel, series, src, watch } from 'gulp' | |
| import { create as bsCreate } from 'browser-sync' | |
| import { buildCss } from './tools/build-css' | |
| import { buildFiles } from './tools/build-files' | |
| import { buildImage } from './tools/build-image' | |
| import { buildPug } from './tools/build-pug' | |
| import { buildSvg } from './tools/build-svg' | |
| import config from './webpack.config' |