Skip to content

Instantly share code, notes, and snippets.

View BagrijRoman's full-sized avatar

Roman Bagrij BagrijRoman

View GitHub Profile
@zmts
zmts / tokens.md
Last active April 20, 2026 12:07
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@stephennancekivell
stephennancekivell / underscore-test.js
Last active October 5, 2016 09:15
A unit testable version of debounce from underscore.js I think underscore needs a flush feature so we can easily test our applications that use it. A underscore.flush method would allow you to test the different cases without having to make your unit tests slow. This could work similar to angular.js's $httpBackend.flush().
describe('underscore', function(){
it('shouldnt execute immediately', function(){
var hasHappened = false;
var fn = underscore.debounce(function(){
hasHappened = true;
}, 100);
expect(hasHappened).toBe(false);