Skip to content

Instantly share code, notes, and snippets.

View roman0x58's full-sized avatar
πŸ„β€β™‚οΈ

Belikin Roman roman0x58

πŸ„β€β™‚οΈ
View GitHub Profile
@zmts
zmts / tokens.md
Last active May 13, 2026 11:18
ΠŸΡ€ΠΎ Ρ‚ΠΎΠΊΠ΅Π½Ρ‹, JSON Web Tokens (JWT), Π°ΡƒΡ‚Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ†ΠΈΡŽ ΠΈ Π°Π²Ρ‚ΠΎΡ€ΠΈΠ·Π°Ρ†ΠΈΡŽ. Token-Based Authentication

ΠŸΡ€ΠΎ Ρ‚ΠΎΠΊΠ΅Π½Ρ‹, JSON Web Tokens (JWT), Π°ΡƒΡ‚Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ†ΠΈΡŽ ΠΈ Π°Π²Ρ‚ΠΎΡ€ΠΈΠ·Π°Ρ†ΠΈΡŽ. Token-Based Authentication

Last major update: 25.08.2020

  • Π§Ρ‚ΠΎ Ρ‚Π°ΠΊΠΎΠ΅ авторизация/аутСнтификация
  • Π“Π΄Π΅ Ρ…Ρ€Π°Π½ΠΈΡ‚ΡŒ Ρ‚ΠΎΠΊΠ΅Π½Ρ‹
  • Как ΡΡ‚Π°Π²ΠΈΡ‚ΡŒ ΠΊΡƒΠΊΠΈ ?
  • ΠŸΡ€ΠΎΡ†Π΅ΡΡ Π»ΠΎΠ³ΠΈΠ½Π°
  • ΠŸΡ€ΠΎΡ†Π΅ΡΡ Ρ€Π΅Ρ„Ρ€Π΅Ρˆ Ρ‚ΠΎΠΊΠ΅Π½ΠΎΠ²
  • ΠšΡ€Π°ΠΆΠ° Ρ‚ΠΎΠΊΠ΅Π½ΠΎΠ²/ΠœΠ΅Ρ…Π°Π½ΠΈΠ·ΠΌ контроля Ρ‚ΠΎΠΊΠ΅Π½ΠΎΠ²
@WaldoJeffers
WaldoJeffers / compose.js
Last active August 6, 2025 13:37
JavaScript one-line compose (ES6)
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)))
// Usage : compose functions right to left
// compose(minus8, add10, multiply10)(4) === 42
//
// The resulting function can accept as many arguments as the first function does
// compose(add2, multiply)(4, 10) === 42
@pathikrit
pathikrit / ProducerConsumer.scala
Last active August 19, 2025 23:29
Single synchronous Producer/Consumer in Scala
import java.util.concurrent.ArrayBlockingQueue
import scala.concurrent.{ExecutionContext, Future}
/**
* Rick's implementation of ghetto back-pressure algo
* Implement this trait and pass it off to ProducerConsumer.Runner to run it
*
* @tparam R Type of result to be crunched
* @tparam S State to iterate on
@OlegIlyenko
OlegIlyenko / CustomJsonScalarType.scala
Last active March 4, 2022 16:48
An example of custom raw JSON scalar type in sangria. DON'T USE IT! By using it you lose many benefits of GraphQL. This just demonstrates that it is possible. If you tempted to expose it, then definitely think twice before using it.
import sangria.ast
import sangria.execution.Executor
import sangria.marshalling.{InputUnmarshaller, ScalarValueInfo, ArrayMapBuilder, ResultMarshaller}
import sangria.schema._
import sangria.validation.{ValueCoercionViolation, IntCoercionViolation, BigIntCoercionViolation}
import spray.json._
import sangria.macros._
import scala.concurrent.ExecutionContext.Implicits.global
implicit object CustomSprayJsonResultMarshaller extends ResultMarshaller {
@jpallari
jpallari / Main.scala
Last active February 5, 2024 08:29
Ways to pattern match generic types in Scala
object Main extends App {
AvoidLosingGenericType.run()
AvoidMatchingOnGenericTypeParams.run()
TypeableExample.run()
TypeTagExample.run()
}
class Funky[A, B](val foo: A, val bar: B) {
override def toString: String = s"Funky($foo, $bar)"
}
@leonardocardoso
leonardocardoso / gitzip.sh
Last active December 22, 2024 21:31
Zip folder ignoring files listed on .gitignore
#...
function gitzip() {
git archive -o $@.zip HEAD
}
#... gitzip ZIPPED_FILE_NAME
@kiritsuku
kiritsuku / ComplexTcpClient.scala
Last active August 15, 2018 06:11
Complex TCP server and client
import scala.io.StdIn
import scala.util._
import akka.actor._
import akka.stream._
import akka.stream.scaladsl._
import akka.stream.stage._
import akka.util._
object ComplexTcpClient extends App {
@kiritsuku
kiritsuku / SimpleTcpClient.scala
Last active April 29, 2018 05:44
Simple TCP client
import scala.io.StdIn
import scala.util._
import akka.actor._
import akka.stream._
import akka.stream.scaladsl._
import akka.stream.stage._
import akka.util._
object SimpleTcpClient extends App {
@Avaq
Avaq / combinators.js
Last active April 20, 2026 05:54
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
'use strict';
var m = require('mithril');
var isFunction = require('lodash/lang/isFunction');
var assign = require('lodash/object/assign');
var minMax = require('client/utils').minMax;
var content, targetDimensions, options, showTimer, isVisible;
function px(value) {