Skip to content

Instantly share code, notes, and snippets.

@zmts
zmts / tokens.md
Last active October 29, 2025 08:59
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@sekika
sekika / gitadd
Last active June 10, 2020 06:09
Safe run of (git add .; git commit; git push)
#!/bin/sh
#
# gitadd - safe run of (git add .; git commit; git push)
#
# Usage: gitadd [commit message]
#
# When adding too many files to github, error may arise such as
# remote: fatal: pack exceeds maximum allowed size
# or
# fatal: The remote end hung up unexpectedly
@treefortress
treefortress / LargeTexturePackerPolicy.cs
Created January 4, 2016 18:05
SpritePacker policy for Unity to allow 4K texture atlases.
using UnityEngine;
using System;
using System.Linq;
using UnityEditor;
using System.Collections.Generic;
public class LargeTexturePackerPolicy : UnityEditor.Sprites.IPackerPolicy
{
protected class Entry
@nadako
nadako / Main.hx
Last active February 19, 2019 02:07
Tuple builder using new Rest feature of @:genericBuild
class Main {
static function main() {
var a = getValue();
}
static function getValue():Tuple<Bool,Int> {
return new Tuple(true, 10);
}
}
@nadako
nadako / ArrayRead.hx
Last active March 14, 2024 07:57
Recursive read-only type generator for JSON structures (based on @:genericBuild)
abstract ArrayRead<T>(Array<T>) from Array<T> {
@:arrayAccess inline function get(i:Int):T return this[i];
public var length(get,never):Int;
inline function get_length() return this.length;
}