Skip to content

Instantly share code, notes, and snippets.

View troggy's full-sized avatar

Kosta Korenkov troggy

View GitHub Profile
@troggy
troggy / gist:4f8e8b1420822219ca9415cba10297bd
Last active January 18, 2021 12:43
Lamoda.ru — Выбрать все материалы неживотного происхождения (веганские)
const cruel = ['войлок', 'велюр', 'замша', 'кожа', 'натуральн', 'спилок', 'шерст', 'мех'];
const probablyCruel = (v) => cruel.find(e => v.startsWith(e));
const checkVegan = () => {
[...document.querySelectorAll('.multifilter_material input[type=checkbox]')]
.forEach(e => !probablyCruel(e.parentNode.innerText) && e.click());
document.querySelector('.multifilter__title').click();
};
@troggy
troggy / gist:8a1cc2565f81f1a6e64a3fed5407f800
Created December 30, 2019 19:38
Postman config for SMT data provider
{
"info": {
"_postman_id": "bbeab965-b977-451c-a0ae-e8c6095acfa1",
"name": "SMT data provider",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "addTreeManually",
"request": {

Sentinel logs:

2019-05-16T02:15:15.581Z tendermint E[2019-05-16|02:15:15.580] Connection failed @ recvRoutine (reading byte) module=p2p peer=a2168aac2fd241a4780a38e104d1eb9d29275555@0.0.0.0:46691 conn=MConn{34.240.43.87:46691} err=EOF
E[2019-05-16|02:15:15.581] Stopping peer for error                      module=p2p peer="Peer{MConn{34.240.43.87:46691} a2168aac2fd241a4780a38e104d1eb9d29275555 out}" err=EOF

2019-05-16T02:15:43.496Z tendermint E[2019-05-16|02:15:43.496] Dialing failed                               module=pex addr=a2168aac2fd241a4780a38e104d1eb9d29275555@34.240.43.87:46691 err="dial tcp 34.240.43.87:46691: i/o timeout" attempts=0

Validator logs when stopped (no error):

@troggy
troggy / node 0
Created March 1, 2019 21:57
Leap integration tests - Consensus failure - 3 validators
2019-03-01T21:51:48.948Z leap-node Syncing events...
2019-03-01T21:51:49.080Z leap-node Synced
2019-03-01T21:51:49.322Z tendermint I[2036-03-02|00:51:49.322] Starting Node module=main impl=Node
2019-03-01T21:51:49.325Z tendermint I[2036-03-02|00:51:49.325] Started node module=main nodeInfo="{ProtocolVersion:{P2P:4 Block:7 App:0} ID_:f6caf507eaf337ad5d45a91fece1e7aa982fd291 ListenAddr:tcp://0.0.0.0:50032 Network:test-chain-6IRAc3 Version:0.26.4 Channels:4020212223303800 Moniker:graybox.local Other:{TxIndex:on RPCAddress:tcp://0.0.0.0:7004}}"
2019-03-01T21:51:49.325Z tendermint E[2036-03-02|00:51:49.325] Couldn't connect to any seeds module=p2p
2019-03-01T21:51:50.334Z tendermint I[2036-03-02|00:51:50.334] Executed block module=state height=1 validTxs=0 invalidTxs=0
troggy@graybox  ~/projects/acebusters/parsec-contracts   master  yarn
yarn install v1.13.0
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
$ cp -n .env.template .env || true
✨ Done in 44.08s.
troggy@graybox  ~/projects/acebusters/parsec-contracts   master  yarn deploy
yarn run v1.13.0
@troggy
troggy / gist:079c7669c6314297cd4c99a045e3c66f
Created January 12, 2019 20:16
Mintable + Burnable ERC20 ABI
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x06fdde03"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x095ea7b3"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x18160ddd"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x23b872dd"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function","signature"
@troggy
troggy / drebedengiToLedger.js
Created August 19, 2018 11:24
Drebedengi to Ledger conversion (very rough)
const fs = require('fs');
const worker = async (filename) => {
console.log(`Reading ${filename}`);
fs.readFile(filename, (err, data) => {
if (err) throw err;
const lines = data.toString().split('\n');
const currencies = {};
const accounts = {};
const openingBalances = [];
0xe69d7406f2DE9032c0512C1b75938a5DB92123f7
@troggy
troggy / CrowdsaleWithPresale.sol
Created April 13, 2018 14:50
Simple CrowdsaleWithPresale contract
pragma solidity ^0.4.18;
import "zeppelin-solidity/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol";
/**
* @title CrowdsaleWithPresale
* @dev Extension of IncreasingPriceCrowdsale contract that increases the price of tokens
* once the specified period has elapsed (presale time).
*/
contract CrowdsaleWithPresale is IncreasingPriceCrowdsale {
@troggy
troggy / gist:35fc70fd42f585fe7231f4d03444d450
Created September 29, 2017 13:56
hands not balancing

Hand 75:

[{
	"M": {
		"address": {
			"S": "0xfa71be989ae5f7ee8a68ba65c05b4884f561a045"
		},
		"last": {
			"S": "AqBF.BhaS7li/W0mzYejhv/onfhGuiEMjM1Ieoz+G4emhBqM=.UX7s5XnGrYrhtyA+RGzTpkLMalQXLi8FPgKN4kTlsOM=.HES6JAAAAEsCAAAAAAfQAAAAAAAAAAAAAAAAAAAAAAA="