Skip to content

Instantly share code, notes, and snippets.

import cats.implicits._
import cats.{ Applicative, Monad }
// Операции над контекстом
trait ContextWriter[F[_]] {
def put(key: String, value: String): F[Unit]
}

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

Object Query Language (OQL)

$ java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

OQL is SQL-like query language to query Java heap. OQL allows to filter/select information wanted from Java heap. While pre-defined queries such as "show all instances of class X" are already supported by HAT, OQL adds more flexibility. OQL is based on JavaScript expression language.

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@DespiteDeath
DespiteDeath / WriteToFileComplete.scala
Created March 23, 2022 07:02 — forked from edwardGunawan/WriteToFileComplete.scala
How to Write Data to a File with FS2
object WriteToFile {
def create[F[_]](
queue: Queue[F, Option[Either[Throwable, String]]],
destinationFile: String
)(implicit blocker: Blocker,
F: Concurrent[F],
cs: ContextShift[F]): F[WriteToFile[F]] = {
def toFile(fileName: String): Pipe[F, String, Unit] =
_.through(text.utf8Encode)
@DespiteDeath
DespiteDeath / AnyToDouble.scala
Created January 23, 2022 23:15 — forked from frgomes/AnyToDouble.scala
Scala - Converts Any to Double, to LocalDate and Date
// this flavour is pure magic...
def toDouble: (Any) => Double = { case i: Int => i case f: Float => f case d: Double => d }
// whilst this flavour is longer but you are in full control...
object any2Double extends Function[Any,Double] {
def apply(any: Any): Double =
any match { case i: Int => i case f: Float => f case d: Double => d }
}
// like when you can invoke any2Double from another similar conversion...
from web3 import Web3, HTTPProvider, IPCProvider
web3 = Web3(IPCProvider('/Users/xen/Library/Ethereum/rinkeby/geth.ipc'))
# web3 = Web3(IPCProvider('/Users/xen/Library/Ethereum/geth.ipc'))
print(web3.eth.blockNumber)
print(web3.eth.accounts)
@DespiteDeath
DespiteDeath / Google XSS challenge solutions..
Created October 14, 2020 20:28 — forked from pbssubhash/Google XSS challenge solutions..
Solutions of the Google XSS Challenge..
Hey All,
I am P.B.Surya.Subhash, a 17 Year coder,hacker and a student.
Recently I happen to see so many posts regarding this " Google XSS Challenge " and i was fortunate enough to complete them..
These are the solutions for the challenges ;)
##############################################################################
Level 1: Hello, world of XSS
https://xss-game.appspot.com/level1/frame
query=<script>alert('xss')</script>
@DespiteDeath
DespiteDeath / Google XSS challenge solutions..
Created October 14, 2020 20:28 — forked from pbssubhash/Google XSS challenge solutions..
Solutions of the Google XSS Challenge..
Hey All,
I am P.B.Surya.Subhash, a 17 Year coder,hacker and a student.
Recently I happen to see so many posts regarding this " Google XSS Challenge " and i was fortunate enough to complete them..
These are the solutions for the challenges ;)
##############################################################################
Level 1: Hello, world of XSS
https://xss-game.appspot.com/level1/frame
query=<script>alert('xss')</script>