Skip to content

Instantly share code, notes, and snippets.

View PavelDemyanenko's full-sized avatar
:octocat:
Right now mostly reacting

xeLL PavelDemyanenko

:octocat:
Right now mostly reacting
View GitHub Profile
register: function(req, res) {
//TODO: Do some validation on the input
if (req.body.password !== req.body.confirmPassword) {
return res.json(401, {err: 'Password doesn\'t match'});
}
User.create({email: req.body.email, password: req.body.password}).exec(function(err, user) {
if (err) {
res.json(err.status, {err: err});
return;
module.exports = function(req, res, next) {
var token;
if (req.headers && req.headers.authorization) {
var parts = req.headers.authorization.split(' ');
if (parts.length == 2) {
var scheme = parts[0],
credentials = parts[1];
if (/^Bearer$/i.test(scheme)) {
index: function(req, res) {
User.findOne(req.token).exec(function(err, message) {
// Work with the user here
});
};
CRDT:
https://github.com/bind-disney/spbrubyconf-2108-crdt-example
react data stores (sets are stored in vesrions vector) (vesrions vector, changes vector)
so the max index of value wins in the case of this structures
merge fucntion is applyied when the replication starts
merge function has access to the index and merge state (vectors)
https://medium.com/piterjs/announce26-917b2eb6b267
A7 data server
контроль теплоснобжения А7 системы
Что такое А7:
data base + applications server = fast big data server
db -> vm+control accsess =>> extenstion, graphs == 1m in memory 50k transactions (couchDB in speed perf)
a7 systems store data in counters for graphics and user actions
https://habr.com/post/351168/
Basic saga flow:
// sagas/index.js
export default function* rootSaga() {
yield fork(dataSaga)
}
// index.js
import rootSaga from './sagas'