Skip to content

Instantly share code, notes, and snippets.

View etienne-napoleone's full-sized avatar

Etienne Napoleone etienne-napoleone

View GitHub Profile
@etienne-napoleone
etienne-napoleone / migrate.py
Created July 24, 2021 22:03
terra ltv bot db migration
import asyncio
import motor
from beanie import Document, Indexed, init_beanie
from pydantic import validator
from terra_ltv_bot import models as new_models
from terra_ltv_bot.terra import is_account_address
OLD_DB = "ltv"
@etienne-napoleone
etienne-napoleone / readme.md
Created March 18, 2021 11:03
Technial readme

Project name

[CI badges]

General description

Requirements

  • Node >= vX.X
. . , , o # # . , o # # . . , , o o o o o , , . . # # o , . # # o , , .
. . , o o # . , , o # . . , o o o # # # o o o , . . # o , , . # o o , .
. , , o # # . , o # . , o o # # # # o o , . # o , . # # o , ,
. , , o # . , o # . , o o # # o o , . # o , . # o , ,
. , , o # . , o # # . , o # . . . . . # o , . # # o , . # o , ,
. , o o # . , o # . , o o # . . , , , . . # o o , . # o , . # o o ,
. , o o # . , o # . , o # . , , o , , . # o , . # o , . # o o ,
. , o o # . , o # . , o # . , o o o , . # o , . # o , . # o o ,
. , o o # . , o # . , o # . , , o , , . # o , . # o , . # o o ,
. , o o # . , o # . , o o # . . , , , . . # o o , . # o , . # o o ,
.anim-rainbow {
background: linear-gradient(270deg,#6f42c1 7.1%,#0366d6 28.4%,#28a745 42.6%,#ffd33d 56.8%,#f66a0a 71%,#d73a49 92.9%,#6f42c1);
animation: MakeItRainbow 4s linear infinite;
}
from datetime import datetime, timedelta
from huey import RedisHuey
from huey import crontab
from huey.exceptions import HueyException
from huey.constants import WORKER_THREAD
import colorlog
@etienne-napoleone
etienne-napoleone / 1-setup.md
Created August 7, 2019 02:43 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

@etienne-napoleone
etienne-napoleone / dirty-oracle.py
Last active June 22, 2019 20:20
Terra validator dirty quick oracle
#!/usr/bin/env python3
import math
import os
import subprocess
import time
import uuid
import requests
# pls see requirements.txt in the gist
@etienne-napoleone
etienne-napoleone / .sh
Last active November 26, 2022 17:17
The TomoChain client flags
Informations on the different networks here: https://docs.tomochain.com/general/networks/
The values are what we recommend to use when running a fullnode or masternode.
required (basic fullnode):
# The id of your network (see networks documentation for the networks ID)
--networkid $ID
# The address of the local account to unlock
--unlock $ACCOUNT
# password file to unlock the account
--password ./password
#!/bin/sh
# get tomochain container id
container_id=$(docker ps -q -f "name=tomochain")
# remove all peers
echo "\n------------------------\n!! Removing all peers\n------------------------\n"
docker exec -t $container_id tomo attach data/tomo.ipc --exec "for (i = 0; i < admin.peers.length; i++) { admin.removePeer(admin.peers[i].id) }"
# add TomoChain peers
@etienne-napoleone
etienne-napoleone / futo.sol
Created March 26, 2019 15:36
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.7+commit.6da8b019.js&optimize=false&gist=
pragma solidity ^0.5.5;
import "github.com/OpenZeppelin/zeppelin-solidity/contracts/math/SafeMath.sol";
import "github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol";
/**
* @title Futo 封筒
* @dev Futo main smart contract
*/
contract Futo is Ownable {