Skip to content

Instantly share code, notes, and snippets.

View DenisCarriere's full-sized avatar
🎯
Focusing

Denis DenisCarriere

🎯
Focusing
View GitHub Profile
@DenisCarriere
DenisCarriere / decode_hex.js
Last active February 7, 2023 05:38
Decode HEX data using Greymass EOSIO library
import { ABI, Serializer } from "@greymass/eosio";
const abi = ABI.from({
structs: [
{
name: "distribute_account",
base: "",
fields: [
{name: "account", type: "name"},
{name: "percent",type: "uint16"}
]
@DenisCarriere
DenisCarriere / stake2vote.ts
Created June 16, 2022 13:24
EOS stake to vote
/**
* voteWeightToday computes the stake2vote weight for EOS, in order to compute the decaying value.
*/
export function voteWeightToday(date: Date): number {
const seconds_per_day = 86400;
const block_timestamp_epoch = new Date(Date.UTC(2000, 0, 1, 0, 0, 0, 0)).getTime();
return Math.floor( (date.getTime() - block_timestamp_epoch) / 1000 / (seconds_per_day * 7)) / 52;
}
@DenisCarriere
DenisCarriere / defiboxsell.cpp
Created October 12, 2021 18:25
Sell using Defibox multi-hop on incoming transfer
#include <eosio.token.hpp>
using namespace eosio;
static constexpr extended_symbol EOS{{"EOS", 4}, "eosio.token"_n };
static constexpr extended_symbol USDT{{"USDT", 4}, "tethertether"_n };
class [[eosio::contract]] defiboxsell : public contract {
public:
using contract::contract;
row1 row2 row3 row4
abc 2021-10-05T02:13:49 fsds 10/05/2021
sfe 2021-10-03T02:13:49 bcc 10/04/2021
@DenisCarriere
DenisCarriere / ecosystem.config.js
Last active April 7, 2019 15:52
DPS pm2 config
module.exports = {
apps : [
{
name: 'dapp-services-node',
script: 'services/dapp-services-node/index.js',
autorestart: true,
log_date_format : "YYYY-MM-DD HH:mm",
env: {
NODEOS_CHAINID: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906',
NODEOS_HOST: '<NODEOS ENDPOINT>',
@DenisCarriere
DenisCarriere / osm-blockchain-protocol.md
Created March 8, 2018 21:14
OpenStreetMap Blockchain Protocol

OpenStreetMap Blockchain Protocol

OpenStreetMap.org (OSM) is a community driven mapping platform that offers completely free & open source mapping data, some would call it the WikiPedia for maps. Anyone is allowed to edit, download & use OpenStreetMap completely for free. Unfortunately, to build DApps using such public mapping database would require an immense amount of work to simply load the data and to keep it updated.

EOS Nation is proposing to develope a protocol which would allow DApps developpers to interact with the OpenStreetMap database directly on the EOS blockchain. In addition an OpenStreetMap monitoring system would be deployed on the EOS blockchain which would continously sync the live OpenStreetMap data to the blockchain.

@DenisCarriere
DenisCarriere / keybase.md
Created March 8, 2018 21:05
Keybase for EOS Nation

Keybase proof

I hereby claim:

  • I am deniscarriere on github.
  • I am eosnation (https://keybase.io/eosnation) on keybase.
  • I have a public key whose fingerprint is 3F68 847E FF55 BCDA F250 E799 36A2 F10D 26E4 9EFF

To claim this, I am signing this object:

@DenisCarriere
DenisCarriere / genesis_public_key
Created March 3, 2018 16:25
genesis_public_key
04df52363b069ceab446d84d148596b993025486c908fe17eccb6969de7396c8883b510cd383e7294d84f00dd5f9d44d8813e1ed962ac45e0db32c5e0a7c1e0532
@DenisCarriere
DenisCarriere / OSM Statistics Tiles.md
Last active September 22, 2017 23:58
OSM Statistic Tiles

OSM Statistics Tiles

The goal of this dataset/project would be to generate geospatial statistics based on OpenStreetMap data and stored as JSON and PBF formats. These pre-computed tiles would enable data scientists to perform complex geospatial analysis at a country wide scale with minimal CPU processing.

Geospatial statitics

There could be thousands of different geospatial statitics that could be generated from a simple OSM dataset within a given BBox, here's a list of the most useful geospatial statitic that would be defined:

  • highway=* (path, residential, secondary, etc...)
@DenisCarriere
DenisCarriere / GIS Homework.md
Last active September 20, 2017 19:37
GIS Homework