Skip to content

Instantly share code, notes, and snippets.

View sascha1337's full-sized avatar
🧠

Sascha1337 sascha1337

🧠
View GitHub Profile
@marioblas
marioblas / add-attributes.js
Last active December 21, 2017 17:41
Underscore.js - Add attributes to each object of an array
/**
* Add attributes to each object of an array.
*
* @param {array} foo - Array of objects where we will add the attibutes
* @param {function} iterator
*/
_.each(foo, function(element, index) {
_.extend(element, {field1: index}, {field2: 'bar', field3: 'baz'});
});
@Wollac
Wollac / ledger-api.md
Created April 6, 2018 06:55
Documentation of the APDU Ledger Nano S API

APDU Ledger API

  • Everything is encoded in Little-Endian without any padding or alignment.
  • Strings have a fixed length but can be null-terminated if they are shorter.
  • All integer numbers are always encoded in 8 bytes using two's complement representation.
  • Boolean values are encoded in one byte, with 0x00 meaning false and any other value meaning true.
  • IOTA addresses are always transferred in their 81 character base-27 encoding without checksum information.

Set the active IOTA seed

@faddat
faddat / pebble-with-mev.bash
Last active March 8, 2023 02:40
use pebbledb and mev-tendermint on any cosmos chain
go mod edit -replace github.com/tendermint/tm-db=github.com/baabeetaa/tm-db@pebble
go mod tidy
go mod edit -replace github.com/tendermint/tendermint=github.com/notional-labs/mev-tendermint@0db69e64a2e87bb29b4417780da30630df97cadd
go mod tidy
go install -ldflags '-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb -X github.com/tendermint/tm-db.ForceSync=1' -tags pebbledb ./...