Skip to content

Instantly share code, notes, and snippets.

View montreal91's full-sized avatar
💭
Set your status

Alexander Nefedov montreal91

💭
Set your status
  • Belgrade, Serbia
View GitHub Profile
@meigwilym
meigwilym / CQRS.md
Last active January 3, 2024 22:15
CQRS, Task Based UIs, Event Sourcing agh!

CQRS, Task Based UIs, Event Sourcing agh!

Posted by gregyoung on February 16, 2010

Many people have been getting confused over what CQRS is. They look at CQRS as being an architecture; it is not. CQRS is a very simple pattern that enables many opportunities for architecture that may otherwise not exist. CQRS is not eventual consistency, it is not eventing, it is not messaging, it is not having separated models for reading and writing, nor is it using event sourcing. I want to take a few paragraphs to describe first exactly what CQRS is and then how it relates to other patterns.

CQRS Command and Query Responsibility Segregation

Starting with CQRS, CQRS is simply the creation of two objects where there was previously only one. The separation occurs based upon whether the methods are a command or a query (the same definition that is used by Meyer in Command and Query Separation, a command is any method that mutates state and a query is any method that returns a value).

@zmts
zmts / tokens.md
Last active April 23, 2024 09:58
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@montreal91
montreal91 / glt.py
Last active October 11, 2015 06:33
values
def GetLuckyTriple( self ):
"""
Метод, который ищет отрезок, содержащий минимум функции.
"""
start = -1
end = self._accuracy * 2 - 1
for i in range( 10000 ):
middle = ( start + end ) / 2
if self._IsTripleLucky( start, end, middle ):
[22:52|jerith@kilrah] ~% virtualenv -p pypy fooenv
Running virtualenv with interpreter /usr/local/bin/pypy
New pypy executable in fooenv/bin/pypy
Installing setuptools, pip, wheel...done.
[22:53|jerith@kilrah] ~% . ./fooenv/bin/activate
(fooenv)[22:53|jerith@kilrah] ~% python
Python 2.7.9 (295ee98b69288471b0fcf2e0ede82ce5209eb90b, Jun 02 2015, 18:26:45)
[PyPy 2.6.0 with GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>>
@Jaza
Jaza / Flask-blueprint-with-imported-routes
Last active March 10, 2024 18:26
Example of how to split a Flask blueprint into multiple files, with routes in each file, and of how to register all those routes.
*