Skip to content

Instantly share code, notes, and snippets.

View mmacedoeu's full-sized avatar
🤓

mmacedo mmacedoeu

🤓
View GitHub Profile
@mmacedoeu
mmacedoeu / .gitignore
Last active May 20, 2021 03:54
slow-timed hash function
/target
@mmacedoeu
mmacedoeu / account.rs
Last active April 13, 2021 17:15
bip143 porting
/// Address type an account is using
#[derive(Copy, Clone, Hash, Eq, PartialEq)]
pub enum AccountAddressType {
/// legacy pay to public key hash (BIP44)
P2PKH,
/// transitional segwit pay to public key hash in legacy format (BIP49)
P2SHWPKH,
/// native segwit pay to public key hash in bech format (BIP84)
P2WPKH,
/// native segwit pay to script

Keybase proof

I hereby claim:

  • I am mmacedoeu on github.
  • I am mmacedoeu (https://keybase.io/mmacedoeu) on keybase.
  • I have a public key ASBruQL0hxnqJ7DsEywRuTShmzInPlIyWXx-AK8sFzRfdgo

To claim this, I am signing this object:

export function flatten(a) {
return Array.isArray(a) ? [].concat(...a.map(flatten)) : a;
}
@mmacedoeu
mmacedoeu / MMTOKEN.json
Created June 1, 2017 22:40
Mix Wallet with Token
[
{
"constant": true,
"inputs": [
{
"name": "_target",
"type": "address"
},
{
"name": "_proxy",
FROM alpine:edge
RUN echo '@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
RUN apk add --no-cache \
cargo@testing \
g++ \
rust@testing \
bash \
openssl \
#[macro_use]
extern crate futures;
extern crate tokio_core;
extern crate tokio_proto;
extern crate bytes;
#[macro_use]
extern crate slog;
extern crate slog_term;
extern crate slog_stdlog;
#[macro_use]
extern crate futures;
extern crate tokio_core as tokio;
extern crate tokio_line as line;
extern crate tokio_service as service;
#[macro_use]
extern crate slog;
extern crate slog_term;
extern crate slog_stdlog;
@mmacedoeu
mmacedoeu / parse.erl
Last active February 25, 2016 00:32
parse
parse_signal([Element|SIGNAL], Index,S)->
io:format("Element (~p): ~p~n ", [Index, Element]),
Sig = S#state.sig,
NewSig = case Index of
0 -> #signal{};
1 -> L = binary_to_list(Element),
io:format("List (~p): ~n ", [L]),
Sig#signal{ symbol = L};
2 -> Sig#signal{ time = Element};
3 -> Sig#signal{ localtick = binary_to_integer(Element)};
@mmacedoeu
mmacedoeu / amqp_example.erl
Created February 15, 2016 19:43
amqp_example.erl
-module(amqp_example).
%% API
-export([start/1,start/0,stop/0,init/2,create/0,sync/0,test/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,terminate/2, code_change/3]).
-behaviour(gen_server).
-include_lib("amqp_client/include/amqp_client.hrl").
%%-compile([export_all]).