Skip to content

Instantly share code, notes, and snippets.

View OR13's full-sized avatar
💭
...

Orie Steele OR13

💭
...
View GitHub Profile
@OR13
OR13 / sidetree.example.js
Last active June 18, 2019 02:38
New Element Sidetree Interface
const sidetree = new element.Sidetree({
blockchain: element.blockchain.ethereum.configure({
hdPath: "m/44'/60'/0'/0/0",
mnemonic: config.mnemonic,
providerUrl: config.web3ProviderUrl,
}),
storage: element.storage.ipfs.configure({
multiaddr: config.ipfsApiMultiAddr,
}),
serviceBus: new element.adapters.serviceBus.ElementNanoBusAdapter(),
@OR13
OR13 / README.md
Created March 1, 2019 15:52
Proverif

ProVerif is a tool for automatically analyzing the security of cryptographic protocols. Support is provided for, but not limited to, cryptographic primitives including:

symmetric and asymmetric encryption; digital signatures; hash functions; bit-commitment; and non-interactive zero-knowledge proofs.

@OR13
OR13 / HyperLedger_Fabric_ChainCodeDev.md
Last active February 8, 2019 01:09
HyperLedger Fabric

new terminal

git clone [email protected]:hyperledger/fabric-samples.git;
cd fabric-samples;
./scripts/bootstrap.sh 1.4.0 1.4.0 0.4.14;
cd chaincode-docker-devmode;
docker-compose -f docker-compose-simple.yaml up;
@OR13
OR13 / merkle-proof-receipts.js
Created January 28, 2019 15:44
Sidetree style merkle proof receipts
const MerkleTools = require("merkle-tools");
const crypto = require("crypto");
const sha256 = data => {
const h = crypto.createHash("sha256");
h.update(data);
return h.digest("hex");
};
let treeOptions = {
@OR13
OR13 / example.js
Created July 12, 2018 16:21
Funding a MetaMask Account with Ganache
const Web3 = require('web3');
const fundMetaMaskFromDefaultAccounts = async (amountETH, providerUrl) => {
if (window.web3) {
const metaMaskWeb3 = window.web3;
const ganacheWeb3 = new Web3(new Web3.providers.HttpProvider(providerUrl));
const getAccounts = someWeb3 => {
return new Promise((resolve, reject) => {
someWeb3.eth.getAccounts(async (err, accounts) => {
if (err) {
@OR13
OR13 / Container.spec.js
Created December 11, 2017 22:21
Container.spec.js
import React from "react";
import { mount } from "enzyme";
import toJSON from "enzyme-to-json";
import { MockedProvider } from "react-apollo/test-utils";
import { addTypenameToDocument } from "apollo-client";
import configureStore from "redux-mock-store";
import { connect } from "react-redux";
import { graphql, compose } from "react-apollo";
import { getPokemon } from "../query";
@OR13
OR13 / Container.js
Created December 11, 2017 21:46
React Apollo Tests
import { graphql, compose } from "react-apollo";
import { getPokemon } from "./query";
import { connect } from "react-redux";
import client from "../Apollo";
import {
pokemonLoadStarted,
pokemonLoaded,
@OR13
OR13 / MyComponent.js
Last active December 11, 2017 21:45
React Enzyme Snapshot Test
class MyComponent extends Component {
render() {
return (<div>MyComponent</div>);
}
}
@OR13
OR13 / address
Created September 1, 2017 03:07
metamask
0x242c3Cb5d8d9E68a8bBfaC9D6704583f1df80AD6
@OR13
OR13 / jiff.js
Created July 11, 2017 21:31
jiff.js
var a = [
{ name: 'a' },
{ name: 'b' },
{ name: 'c' },
]
var b = a.slice();
b.splice(1, 1);
b.push({ name: 'd' });