Skip to content

Instantly share code, notes, and snippets.

View DenisCarriere's full-sized avatar
🎯
Focusing

Denis DenisCarriere

🎯
Focusing
View GitHub Profile
@DenisCarriere
DenisCarriere / simplehash.openapi.json
Created March 25, 2025 15:14
SimpleHash OpenAPI JSON
This file has been truncated, but you can view the full file.
{
"openapi": "3.1.0",
"info": {
"title": "SimpleHash API",
"version": "0.1"
},
"servers": [
{
"url": "https://api.simplehash.com/api/v0/"
}
@DenisCarriere
DenisCarriere / keybase.md
Last active February 11, 2025 16:39
keybase.md

Keybase proof

I hereby claim:

  • I am deniscarriere on github.
  • I am pinax (https://keybase.io/pinax) on keybase.
  • I have a public key ASCsJSYy130ZYs0Bhf6GHBLEN7a20SVySWi909zDoh1I1go

To claim this, I am signing this object:

@DenisCarriere
DenisCarriere / bytes_to_big_endian_hex.py
Created November 18, 2024 21:07
Snowflake to UInt256
-- Modified BYTES_TO_BIG_ENDIAN_HEX function
CREATE OR REPLACE FUNCTION BYTES_TO_BIG_ENDIAN_HEX(hex_str STRING)
RETURNS STRING
LANGUAGE PYTHON
RUNTIME_VERSION = '3.8'
HANDLER = 'bytes_to_big_endian_hex'
AS
$$
def bytes_to_big_endian_hex(hex_str):
# Validate input length (must be even)
@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: