Skip to content

Instantly share code, notes, and snippets.

View srghma's full-sized avatar

Serhii Khoma srghma.github.io/how-life-was-created srghma

View GitHub Profile
@srghma
srghma / pBFT— Understanding the Consensus Algorithm.md
Created September 4, 2021 10:53
pBFT— Understanding the Consensus Algorithm

download

(1) request: the client sends a request to the master node.

(2) pre-prepared: The master node receives the request from the client and needs to verify whether the signature of the client request message is correct. If correct, a pre-prepare message is broadcast to other replica nodes.

(3) prepared: the replica node receives the pre-prepare message from the master node and carries out verification. If correct, the replica node sends a prepare message to other nodes, including the primary.

@srghma
srghma / 1.md
Last active November 21, 2021 13:01
Near DeFi

original

data DoorState = Open | Closed

data Door : DoorState -> Type where
     MkDoor : (doorId : Int) -> Door st

openDoor : (1 d : Door Closed) -> Door Open
<div class="hanzi" id="hanzi">{{Hanzi}}</div>
<br>
<div class="pinyin" id="pinyin">{{Pinyin}}</div>
<br>
{{English}}
<br>
@srghma
srghma / LICENSE
Last active May 22, 2020 08:21
This license applies to all public gists and my comments in https://gist.github.com/srghma
MIT License
Copyright (c) 2020 Serhii Khoma
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

I write commits with this linter https://github.com/srghma/linted-git-commit

Structure:

type: scope (e.g. page name) or noun -> scope (e.g. widget name) or noun -> verb (optional)

I use only 3 varians of "type":

  • feat: Adds a new feature.
module GameLoopSpec where
import Protolude
import Cli.AbstractUtils
import Cli.GameLoop
import Cli.Monads
import Cli.Types
import Test.Hspec
stage_ssh () {
ssh \
root@${stage_ip} \
-i ${toString ../secrets/stage_root_key} \
$@
}
state_nixos_rebuild () {
NIX_SSHOPTS="-i ${toString ../secrets/stage_root_key}" \
nixos-rebuild \
```js
async function fetch(_ignoring) {
return {
user: {
username: "MyUsername"
}
}
}
async function fetchUserAndDoCalaculation() {