Skip to content

Instantly share code, notes, and snippets.

View Interfere's full-sized avatar
:octocat:
Focus time

Alexey Ushakov Interfere

:octocat:
Focus time
  • Delivery Hero
  • Berlin
View GitHub Profile
@zmts
zmts / tokens.md
Last active July 29, 2024 19:21
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@CodaFi
CodaFi / AlgorithmW.swift
Last active July 28, 2024 10:04
A Swift Playground containing Martin Grabmüller's "Algorithm W Step-by-Step"
/// Playground - noun: a place where people can play
/// I am the very model of a modern Judgement General
//: # Algorithm W
//: In this playground we develop a complete implementation of the classic
//: algorithm W for Hindley-Milner polymorphic type inference in Swift.
//: ## Introduction
@jochenschoellig
jochenschoellig / ChatCollectionViewFlowLayout.swift
Created January 19, 2017 15:49
A subclass of UICollectionViewFlowLayout to get chat behavior without turning collection view upside-down. This layout is written in Swift 3 and absolutely usable with RxSwift and RxDataSources because UI is completely separated from any logic or binding.
import UIKit
class ChatCollectionViewFlowLayout: UICollectionViewFlowLayout {
private var topMostVisibleItem = Int.max
private var bottomMostVisibleItem = -Int.max
private var offset: CGFloat = 0.0
private var visibleAttributes: [UICollectionViewLayoutAttributes]?
@nikreiman
nikreiman / initAudioSession.c
Created May 3, 2012 07:55
Recording and processing audio on iOS
// Yeah, global variables suck, but it's kind of a necessary evil here
AudioUnit *audioUnit = NULL;
float *convertedSampleBuffer = NULL;
int initAudioSession() {
audioUnit = (AudioUnit*)malloc(sizeof(AudioUnit));
if(AudioSessionInitialize(NULL, NULL, NULL, NULL) != noErr) {
return 1;
}