Skip to content

Instantly share code, notes, and snippets.

Anton Kaliaev melekes

Block or report user

Report or block melekes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@melekes
melekes / README.md
Last active Jun 1, 2019
Requirements for a Tendermint client
View README.md

Requirements for a Tendermint client

Broadcasting transactions

  1. An evil proposer can drop valid transactions (https://github.com/tendermint/tendermint/issues/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

@melekes
melekes / client.go
Created Mar 5, 2019
Example of using Tendermint HTTP client to subscribe for new block headers
View client.go
package main
import (
"context"
"os"
"os/signal"
"syscall"
"github.com/tendermint/tendermint/libs/log"
@melekes
melekes / badger_db.go
Last active Jan 30, 2019
Alternative databases, which were used to benchmark Tendermint indexing
View badger_db.go
package db
import (
"bufio"
"io"
"os"
"sync"
"github.com/dgraph-io/badger"
)
@melekes
melekes / twopy.py
Last active Jul 21, 2017 — forked from iamsteadman/twopy.py
Add your Twitter friends' RSS feeds to a single OPML file
View twopy.py
# -*- coding: utf-8 -*-
"""
This script requires the following Packages
1: Twitter: https://pypi.python.org/pypi/twitter
2: PyQuery: https://pypi.python.org/pypi/pyquery
3: Jinja2: https://pypi.python.org/pypi/Jinja2
It's fairly primitive but works. It uses a Jinja2 template to create an OPML
file from the RSS feeds of the websites run by the people you follow on
@melekes
melekes / upgrade_tendermint.yml
Last active Apr 24, 2017
Ansible playbook for upgrading Tendermint
View upgrade_tendermint.yml
---
- hosts: all
tasks:
- name: get version
shell: tendermint version
register: version
- name: copy and unpack binary if newer version is being installed
View counter.systemd.j2
[Unit]
Description=Counter
Requires=network-online.target
After=network-online.target
[Service]
Environment=""
Restart=on-failure
User={{ user }}
Group={{ group }}
View overflow_uint64.go
// 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
View keybase.md

Keybase proof

I hereby claim:

  • I am melekes on github.
  • I am melekes (https://keybase.io/melekes) on keybase.
  • I have a public key ASA1kz6kxvacyRSjua9gxErX7nt2n46FvBFB-OfWYp572go

To claim this, I am signing this object:

View property-based-testing-tools.md

Any other languages or suggestions? Comment below.

.NET (C#, F#, VB)

Python:

  • Factcheck -- requires a test framework (I like pytest), I wrote it (benefits - you can ask me about it, drawbacks - it's not very mature). Can be installed from PyPI with Pip or easy_install.
  • Hypothesis -- requires a test framework, provides decorators for easy integration
@melekes
melekes / README.md
Last active Aug 11, 2016
How to learn any language in six months | Chris Lonsdale | TEDxLingnanUniversity
View README.md

https://www.youtube.com/watch?v=d0yGdNEWdn0

Краткое содержание

Принципы:

  1. Фокусируйте внимание на контенте, имеющем для вас какое-то значение
  2. Используйте язык как средство для коммуникации начиная с первого дня
  3. Если вы сначала поймёте то, что вам хотели сказать, то вы начинаете овладевать языком бессознательно (comprehensive input)
  4. Изучение нового языка - это также тренировка тела (правильное произношение зависит от мышц)
You can’t perform that action at this time.