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, { Component } from 'react'; | |
const firebase = window.firebase; | |
const config = { | |
apiKey: "", | |
authDomain: "", | |
databaseURL: "", | |
storageBucket: "", | |
messagingSenderId: "" | |
}; |
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 { stringify } from "query-string"; | |
export const HTTP_HEADER_TYPES = { | |
json: "application/json", | |
text: "application/text", | |
form: "application/x-www-form-urlencoded", | |
multipart: "multipart/form-data" | |
}; | |
const status = 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
<textarea onkeydown='if(event.keyCode===9){var v=this.value,s=this.selectionStart,e=this.selectionEnd;this.value=v.substring(0, s)+" "+v.substring(e);this.selectionStart=this.selectionEnd=s+4;return false;}'></textarea> |
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 noWww(req, res, next) { | |
if (req.hostname.match(/^www\./) !== null) { | |
res.redirect(301, req.protocol + '://' + req.hostname.replace(/^www\./, '') + req.originalUrl); | |
} else { | |
next(); | |
} | |
} |
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 https(req, res, next) { | |
if (req.secure) | |
next(); | |
else if (req.method === 'GET') | |
res.redirect(301, `https://${req.headers.host}${req.originalUrl}`); | |
else | |
res.status(403).send('Для доступа к сайту необходимо использовать защищенное соединение через HTTPS.'); | |
} |
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(module, exports) { | |
var __styleE = document.getElementById("style"); | |
(window.React = parent.React), | |
(window.ReactDOM = parent.ReactDOM), | |
(window.PropTypes = parent.PropTypes), | |
(window._ = parent._), | |
(window.axios = parent.axios), | |
(window.subscribeEmail = parent.subscribeEmail), | |
(window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = | |
parent.__REACT_DEVTOOLS_GLOBAL_HOOK__), |
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 passport = require('passport'); | |
const LocalStrategy = require('passport-local').Strategy; | |
const options = { | |
usernameField: 'email', | |
passwordField: 'password', | |
passReqToCallback: true | |
}; | |
passport.use('register', new LocalStrategy(options, (req, email, password, done) => { |
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 JwtStrategy = require('passport-jwt').Strategy; | |
const ExtractJwt = require('passport-jwt').ExtractJwt; | |
const User = require('../../shared/models/data').User; | |
const errorHandler = require('../../shared/utils').errorHandler; | |
const options = { | |
secretOrKey: cfg.jwtSecret, | |
jwtFromRequest: ExtractJwt.fromAuthHeader() | |
}; |
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
'use strict'; | |
var subjects = ['программирование', 'веб-разработку', 'HTML', 'CSS', 'JavaScript', 'React', 'Angular', 'Node.js']; | |
var element = $('#hero .subject'); | |
var subjectIndex = 0; | |
(function printSubjects() { | |
printSubject(subjects[subjectIndex]) | |
.then(function() { | |
var timeout = setTimeout(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
'use strict'; | |
var $choices = $('.choice'); | |
var $total = $('.total .number'); | |
$choices.on('click', function (event) { | |
var price = $(this).data('price'); | |
$total.text(price); | |
changeNumber('.total .number'); | |
}); |