Skip to content

Instantly share code, notes, and snippets.

@nnkken
nnkken / main.go
Created August 3, 2019 13:40
Cosmos decode tx
package main
import (
"fmt"
"encoding/base64"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authTypes "github.com/cosmos/cosmos-sdk/x/auth/types"
nameTypes "github.com/cosmos/sdk-application-tutorial/x/nameservice/types"
)
@nnkken
nnkken / build.sh
Last active May 31, 2019 15:30
Instruction of joining LikeChain Cosmos Testnet
#!/bin/bash
set -e
COSMOS_BUILD_TAG="v0.34.6"
git clone https://github.com/cosmos/cosmos-sdk
pushd cosmos-sdk
git checkout $COSMOS_BUILD_TAG
make install tools
@nnkken
nnkken / draft-ietf-oauth-security-topics-11.md
Created February 25, 2019 08:54
OAuth 2.0 related RFCs
Web Authorization Protocol                                T. Lodderstedt
Internet-Draft                                                   yes.com
Intended status: Best Current Practice                        J. Bradley
Expires: 1 July 2019                                              Yubico
                                                             A. Labunets
                                                                Facebook
                                                                 D. Fett
                                                                 yes.com
                                                        28 December 2018
@nnkken
nnkken / Relay.sol
Last active September 15, 2018 11:04
Comparing gas consumption for parsing JSON and Amino messages
// Copyright (C) 2018 LikeCoin Foundation Limited
//
// This file is part of LikeCoin Smart Contract.
//
// LikeCoin Smart Contract is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// LikeCoin Smart Contract is distributed in the hope that it will be useful,
@nnkken
nnkken / README.md
Last active August 6, 2018 03:11
Example ABCI server

This is an example ABCI server program, which gives you a basic impression about how does an ABCI server works with Tendermint.

You can also try to delete the DB (/tmp/num-adder.db), or reset block info (tendermint unsafe_reset_all) to see what will happen.

Tendermint version

0.22.8-40d6dc2e

Run the node

module.exports = {
storageProviders: {
puttyimages: '0x0102030405060708091011121314151617181920',
},
};
@nnkken
nnkken / index.html
Created April 9, 2018 03:18
Signature Test (iOS UTF-8 message)
<!DOCTYPE html>
<html>
<head>
<title>Signature Test</title>
</head>
<body>
<div id="from"></div>
<div id="sig"></div>
<div id="recover"></div>
<script src="dist/index.js"></script>
@nnkken
nnkken / index.html
Created April 6, 2018 05:01
Signature Test
<!DOCTYPE html>
<html>
<head>
<title>Signature Test</title>
</head>
<body>
<div id="from"></div>
<div id="sig"></div>
<script src="dist/index.js"></script>
</body>
git config --global alias.lg1 "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
git config --global alias.lg2 "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit"
require "openssl"
def enumerate(n, set, target)
set.repeated_permutation(n) do |arr|
if OpenSSL::Digest.digest("sha1", OpenSSL::Digest.digest("sha1", arr.join)) == target
return arr
end
end
return nil
end