Skip to content

Instantly share code, notes, and snippets.

View melekes's full-sized avatar

Anton Kaliaev melekes

View GitHub Profile
@melekes
melekes / README.md
Last active February 22, 2022 13:07
Wavegirls Dashing widget

Wavegirls

Wavegirls

Description

Dashing widget to display random girls. Check out this video to see how it works.

Installation

@melekes
melekes / bst.rs
Created December 27, 2021 09:44
BST || k_largest element
use anyhow::anyhow;
use anyhow::Result;
use std::mem::swap;
type Child = Option<Box<Node>>;
#[derive(Debug, Eq, PartialOrd, PartialEq, Clone)]
pub struct Node {
pub value: i32,
@melekes
melekes / property-based-testing-tools.md
Last active May 15, 2021 11:38 — forked from npryce/property-based-testing-tools.md
Property-Based Testing Tools
@melekes
melekes / README.md
Created August 30, 2013 08:51
Yet another Google Calendar Dashing widget

Yet another Google Calendar Dashing widget

Yet another Google Calendar Dashing widget

Description

Dashing widget to display first two coming-up Google Calendar events.

Basically, you do not need more than two events on your dashboard, but it can be easily extended to the neighboring cells and show, say, 4 events instead of 2.

package log
import (
"fmt"
"io"
stdlog "log"
"strings"
)
type stdlibLogger struct {
@melekes
melekes / notes.md
Created February 15, 2020 08:43 — forked from calebamiles/notes.md
Notes on Open Source Governance Models

Node.js Foundation

  • Healthy Open Source
    • explicit goal to be a lightweight process
    • concrete ability to scale to hundreds of contributors
    • good fundamental goals
      • transparency
      • participation
      • efficacy
    • ecosystem projects encouraged but not required to adopt foundation governance templates
  • creation of projects under TSC explicity delegates authority from TSC to project TC
// addOrMax performs safe addition: if result overflows, it returns MaxUint64
func addOrMax(accum, value uint64) uint64 {
if (accum + value) < accum {
return math.MaxUint64
} else {
return accum + value
}
}
// subOrZero performs safe subtraction: if result underflows, it returns 0
@melekes
melekes / do_monad.erl
Last active December 27, 2019 08:47
Erlang snippets
-spec do(any(), [fun((...) -> any())]) -> any().
do(Arg, []) ->
Arg;
do(Arg, [Fun | Funs]) ->
case Fun(Arg) of
{error, Data} ->
Data;
Data ->
do(Data, Funs)
@melekes
melekes / talks.md
Last active December 27, 2019 08:22
The list of my favorite talks.
@melekes
melekes / README.md
Last active June 1, 2019 03:30
Requirements for a Tendermint client

Requirements for a Tendermint client

Broadcasting transactions

  1. An evil proposer can drop valid transactions (tendermint/tendermint#3322). To ensure tx A will be committed, the client needs to a) send it to multiple nodes b) subscribe for its result https://tendermint.com/docs/app-dev/subscribing-to-events-via-websocket.html or query the result later using /tx API endpoint (requires the tx indexer enabled) https://tendermint.com/rpc/#tx.

  2. Multiple nodes above requirement comes from a simple fact that an evil node can drop your tx.

Quering