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
import urllib.request, json | |
# Will get users interacting with these repos | |
repositories = [ | |
'docknetwork/sdk', | |
'docknetwork/dock-substrate', | |
'docknetwork/rify', | |
'docknetwork/vc-api', | |
'docknetwork/vcdm-verifier', | |
'docknetwork/price-feed-adapter', |
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
{ | |
"Address": "MultiAddress", | |
"LookupSource": "MultiAddress", | |
"Keys": "SessionKeys2", | |
"PerDispatchClassU32": { | |
"type": "struct", | |
"type_mapping": [ | |
["normal", "u32"], | |
["operational", "u32"], | |
["mandatory", "u32"] |
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
pragma solidity ^0.4.14; | |
pragma experimental ABIEncoderV2; | |
import './verifier.sol'; | |
contract TempContract is Verifier { | |
bool public success = false; | |
event Trace0(string); | |
function verifyFifteen( | |
uint[2] a, | |
uint[2] a_p, |
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
pragma solidity ^0.4.14; | |
library Pairing { | |
struct G1Point { | |
uint X; | |
uint Y; | |
} | |
// Encoding of field elements is: X[0] * z + X[1] | |
struct G2Point { | |
uint[2] X; |
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 Web3 = require("../node_modules/web3/"); | |
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); | |
var Verifier = require("../contracts/Verifier.sol"); | |
contract('Verifier', function (accounts) { | |
var verifier; | |
before(function () { | |
return Verifier.new({ from: web3.eth.accounts[0], value: 10000000000000000000, gas: 2100000 }) |
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
# Add integer keys in rocksdb and get highest and lowest keys using a custom comparator | |
import random | |
import string | |
from time import perf_counter | |
import rocksdb | |
from rocksdb.interfaces import Comparator | |
class IntegerComparator(Comparator): |
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
from random import shuffle | |
import ujson | |
import msgpack | |
import time | |
data = [ | |
{"op":"REPLY","result":{"txnTime":1500296923,"rootHash":"ChEG5bpqvdKYhyoqSziJ5r7qtyRtkmjQYzErEW2DpuqC","type":"buy","auditPath":["3uAnG8h5rS5nwviEj49YTje8GA8tS19RsUP3MvSju9gG"],"signature":"5RGoVb8Rsc4H1jn2FZdueBAZ3kMzwJhEzLUjxtMhzXSBnQBuE438uj8Bg1b5eP82EYNKVNwFSarztQoDszid6n8w","reqId":1500316722698678,"identifier":"4AdS22kC7xzb4bcqg9JATuCfAMNcQYcZa1u5eWzs6cSJ","seqNo":33,"amount":10}}, | |
{"op":"REPLY","result":{"txnTime":1500296923,"rootHash":"FMWErPC9tCMusWjwfgLkhKoibQbwWWoCYWjFj9TTmHuj","type":"buy","auditPath":["AbBrT7ScWCPdKkCue5SyWx8jCvUFwgDPBSumNtGmuLYG","7qB28FcEsR93j3CrmYpAG5r1JJZAVrNHWtMKcYHspgkY","7CGsMw6jBaq8Cm5dfb1BmoV1LHk4kVjRYV83r4B1xMw9"],"signature":"3xuFE9kEo8L991Z4ztLuwgyeUTTbTW6dauKLcMbbeFffK1hRj6ywTGz3m5nhzEk5LqQQsfXTd7rq6hHchnpUSxzg","reqId":1500316722693789,"identifier":"4AdS22kC7xzb4bcqg9JATuCfAMNcQYcZa1u5eWzs6cSJ","seqNo":29,"amount":28}}, | |
{"op":"REPLY","result":{"txnTime":1500296923,"rootHash":"Dj2VKTBE |
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
Verifying that +lovesh is my blockchain ID. https://onename.com/lovesh |
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
import itertools | |
name = 'FirstName MiddleName LastName' | |
company_domain = 'company.com' | |
name_parts = name.lower().split(' ') | |
fname, mname, lname = None, None, None | |
if len(name_parts) > 0: | |
fname = name_parts[0] |
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
import lxml.html | |
import urllib2 | |
class DOM(object): | |
def __init__(self, url=None, html=None, utf8=False): | |
if url: | |
page = urllib2.urlopen(url) | |
html = page.read() | |
page.close() |
NewerOlder