Skip to content

Instantly share code, notes, and snippets.

View r-marques's full-sized avatar

Rodolphe Marques r-marques

View GitHub Profile
@r-marques
r-marques / text_to_btc_address.py
Created June 2, 2015 07:44
Encode text in bitcoin addresses
import requests
from pycoin import encoding
HASHTOADDRESS = "https://blockchain.info/q/hashtoaddress/{}"
def text_to_address(text):
if len(text) > 20:
raise ValueError('Text needs to be below 20 bytes')
else:
text = text + ' ' * (20 - len(text))
[diff]
tool = pycharm
[difftool "pycharm"]
cmd = /usr/local/bin/pycharm diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read
[merge]
tool = pycharm
keepBackup = false
[mergetool "pycharm"]
cmd = /usr/local/bin/pycharm merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED"

Keybase proof

I hereby claim:

  • I am r-marques on github.
  • I am rmarques (https://keybase.io/rmarques) on keybase.
  • I have a public key whose fingerprint is 49FE 5FDE EBBD 8A47 A2F0 9466 6184 CB6A 7182 8027

To claim this, I am signing this object:

@r-marques
r-marques / benchmark_get_unspents.py
Created November 23, 2016 12:55
Benchmark BigchainDB get_unspents
import os
import random
import time
import rethinkdb as r
from bigchaindb import Bigchain
from bigchaindb.models import Transaction
from bigchaindb.common.crypto import generate_key_pair
from bigchaindb.util import ProcessGroup
@r-marques
r-marques / python_protobuf_build.md
Last active April 11, 2019 07:17
Python custom build steps for protobuf files
@r-marques
r-marques / publishing_data.py
Last active January 7, 2021 14:39
Publishing Data example
metadata_bank_a = {
"main": {
"name": "Credit Card Data Part 1",
"dateCreated": "2021-01-07T09:45:09Z"
"author": "Bank A",
"license": "",
"price": "1",
"files": [
{
"index": 0,
@r-marques
r-marques / consuming_data.py
Last active January 7, 2021 14:39
Consuming data example
service_agreement_bank_a = nevermined.assets.order(
"did:nv:36c9657aab6395d29bf9471a060b1711933193ad84c9675a38a63e09ff6d8a38",
ServiceTypesIndices.DEFAULT_COMPUTING_INDEX,
data_scientist_account
)
print(f"Service Agreement with Bank A: {service_agreement_bank_a}")
"Service Agreement with Bank A: 0x37de8d58f3a34a128889ac7d4f24dcc992b422feb03e4578983f931d7bb4cbfa"
@r-marques
r-marques / participant.py
Created January 7, 2021 14:31
FL participant
from xain_sdk import ParticipantABC, run_participant
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
class Participant(ParticipantABC):
def __init__(self, data):
super().__init__()
@r-marques
r-marques / publish_algorithm.py
Last active January 7, 2021 14:38
Publish algorithm
metadata_algorithm = {
"main": {
"name": "Fraud Detection Algorithm",
"dateCreated": "2021-01-07T09:45:09Z",
"author": "Data Scientist",
"license": "",
"price": "0",
"files": [
{
"index": 0,
@r-marques
r-marques / workflow.py
Last active January 7, 2021 14:38
Workflow
metadata_workflow = {
"main": {
"name": "Creditcard Fraud workflow",
"dateCreated": "2021-01-07T09:45:09Z",
"author": "Data Scientist",
"license": "",
"price": "0",
"type": "workflow",
"workflow": {