This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"index": { | |
"fields": ["name"] | |
}, | |
"ddoc": "index@1.0.0", | |
"name": "name-index", | |
"type": "json" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Referesh automatially | |
<script type="text/javascript"> | |
setTimeout(function(){ | |
location = '' | |
},60000) | |
</script> | |
//Hard Refersh | |
location.reload(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2018 Jasti Sri Radhe Shyam | |
// Permission is hereby granted, free of charge, to any person obtaining | |
// a copy of this software and associated documentation files (the "Software"), | |
// to deal in the Software without restriction, including without limitation | |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
// and/or sell copies of the Software, and to permit persons to whom the | |
// Software is furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// Importing libraries | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func main() { | |
// Sample JSON string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ucFirstAllWords( str ) | |
{ | |
var pieces = str.split(" "); | |
for ( var i = 0; i < pieces.length; i++ ) | |
{ | |
var j = pieces[i][0].toUpperCase(); | |
pieces[i] = j + pieces[i].substr(1).toLowerCase(); | |
} | |
return pieces.join(" "); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var someFunctionToUse = function (obj) { | |
// Form data | |
var formData = new FormData(); | |
// Appending the files data in form data | |
formData.append("doc_file", document.getElementById("upload_input_id").files[0]); | |
// (Example) attribute from an object | |
formData.append("data_filed_name", obj.getAttribute("object_attribute_name")); | |
// Creating the Request object | |
var oReq = new XMLHttpRequest(); | |
// Creating event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IPv4 | |
var regexStringIPv4 = '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'; | |
var regexIPv4 = new RegExp(regexStringIPv4, flags); | |
console.log(regexIPv4.test("192.168.0.25.25.23")); // false | |
console.log(regexIPv4.test("192.168.0.25")); // true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"validPort" : ["256"], | |
"invalidPort" : [], | |
"minPort" : "1000", | |
"maxPort" : "1200" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modprobe.blacklist=nouveau i915.enable_rc6=0 i915.enable_psr=0 i915.preliminary_hw_support=1 i915.enable_hd_vgaarb=1 intel_idle.max_cstate=1 nvidia-drm.modeset=1 |
OlderNewer