Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Building

Gautham Santhosh gauthamzz

🚀
Building
View GitHub Profile
View random.js
var randomdata = [
{
date: 1547126422.489,
value: 21
},
{
date: 1521688318.548,
value: 26
},
{
View paywall.js
<script src="https://raw.githubusercontent.com/gauthamzz/ayyo/master/serve/paywall.js"></script>
View query.py
def query(self, req):
value = self.state.db.get(prefix_key(req.data))
return ResponseQuery(code=CodeTypeOk, value=value)
View commit.py
def commit(self):
byte_length = max(ceil(self.state.size.bit_length() / 8), 1)
app_hash = self.state.size.to_bytes(byte_length, byteorder='big')
self.state.app_hash = app_hash
self.state.height += 1
self.state.save()
return ResponseCommit(data=app_hash)
View deliver_tx.py
def deliver_tx(self, tx):
"""Validate the transaction before mutating the state.
Args:
raw_tx: a raw string (in bytes) transaction.
"""
parts = tx.split(b'=')
if len(parts) == 2:
key, value = parts[0], parts[1]
else:
key, value = tx
View state.py
class State(object):
def __init__(self, db, size, height, apphash):
self.db = db
self.size = size
self.height = height
self.apphash = apphash
View kvstoretendermint.sh
# Create the genesis block, for the node.
tendermint init
# Now that the gensis block is inilaised we can start
# the application on the system
tendermint node --proxy_app=kvstore
# This will start the kvstore application in your
# computer in port 26657.
# Lets test the kv store application by sending a request to the application
@gauthamzz
gauthamzz / abci-console.sh
Last active Jan 31, 2019
Tendermint KV store
View abci-console.sh
# Lets do in a different way
tendermint init --home ".node"
# Start a tendermint node
tendermint node --home ".node"
# Open a new terminal and start kvstore from abci-console
abci-console kvstore
# Open new terminal and start abci-console
View test.json
{
"name": "mast rcnn balloon",
"version": "2.1",
"url": "https://github.com/matterport/Mask_RCNN/releases/download/v2.1/mask_rcnn_balloon.h5",
"description": "We train the model to detect balloons only, and then we use the generated masks to keep balloons in color while changing the rest of the image to grayscale.",
"input_parameters": "<optional>",
"output_parameters": "<optional",
"repository": {
"type": "git",
"sample": "https://github.com/matterport/Mask_RCNN/tree/master/samples/balloon",
View blockstack
Verifying my Blockstack ID is secured with the address 1AsKEABwZNuuY8PuYQaGPfvv9nLEr4gkSA https://explorer.blockstack.org/address/1AsKEABwZNuuY8PuYQaGPfvv9nLEr4gkSA