Skip to content

Instantly share code, notes, and snippets.

View jastisriradheshyam's full-sized avatar
🪀
((~~~))

Jasti Sri Radhe Shyam jastisriradheshyam

🪀
((~~~))
View GitHub Profile
@jastisriradheshyam
jastisriradheshyam / couchdb_index_format_example.json
Created April 17, 2018 12:22
Couch DB index creation example.
{
"index": {
"fields": ["name"]
},
"ddoc": "index@1.0.0",
"name": "name-index",
"type": "json"
}
@jastisriradheshyam
jastisriradheshyam / marbles_all_names.go
Created April 17, 2018 09:43
Get all the objects (marble) names in the ledger
//Shows all the marbles or objects in the ledger (blockchain)
//This is a marbles chaincode (hyperledger fabric samples) related code.
// Jasti Sri Radhe Shyam
func (t *SimpleChaincode) getMarblesByRangeAll(stub shim.ChaincodeStubInterface) pb.Response {
//Gets all the data with undefined range
resultsIterator, err := stub.GetStateByRange("", "")
if err != nil {
return shim.Error(err.Error())
}
@jastisriradheshyam
jastisriradheshyam / synchronous_sleep.js
Last active October 1, 2020 11:10
Its a synchronous sleep function.
/*
Usage:
-------------------------------------------------
var syn_timeout = require('synchronous_timeout');
//some code
await syn_timeout.pause(300);
//some code
-------------------------------------------------
if defined and used in a same file:
-------------------------------------------------