Skip to content

Instantly share code, notes, and snippets.

View arvindkalra's full-sized avatar

Arvind Kalra arvindkalra

View GitHub Profile
@arvindkalra
arvindkalra / ServicesSDK.js
Created August 8, 2020 13:58
SDK which can be used to make get, post, put, patch, delete requests to other services using basic auth
/**
* @author Arvind Kalra <kalarvind97@gmail.com>
* @profile https://github.com/arvindkalra
* @date 08/08/20
*/
import axios from "axios";
import _ from "lodash";
const reqFunctions = {
@arvindkalra
arvindkalra / ABI
Last active February 14, 2020 13:27
GoFundMe
[{"constant":true,"inputs":[],"name":"getTotalApprovalRequests","outputs":[{"name":"total","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getNumberOfSpendings","outputs":[{"name":"numSpendings","type":"uint256"},{"name":"numSpendingsOpen","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"index","type":"uint256"},{"name":"to","type":"address"},{"name":"amount","type":"uint256"},{"name":"receipt","type":"string"},{"name":"isOpen","type":"bool"}],"name":"spendDonations","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getCampaign","outputs":[{"name":"campaignName","type":"string"},{"name":"owner","type":"address"},{"name":"supportingDocuments","type":"string"},{"name":"totalDonations","type":"uint256[4]"},{"name":"times","type":"uint256[2]"},{"name"
const express = require("express");
const app = express();
const Web3 = require("web3");
const abi = [
{
constant: false,
inputs: [],
name: "emitEvent",
outputs: [],
Ursula - nucypher ursula run --dev --federated-only
Alice - nucypher alice run --dev --federated-only --teacher 127.0.0.1:10151
Bob - nucypher bob run --dev --federated-only --teacher 127.0.0.1:10151 --controller-port 4000
Enrico - nucypher enrico run --policy-encrypting-key <Key from Policy Creation> --http-port 5000
Create Policy -
POST
localhost:8151/derive_policy_encrypting_key/<Label>
# I just made a simple change in this function, which is making cache=True over here in the function defination
def retrieve(self, message_kit, data_source, alice_verifying_key, label, cache=True):
print("changed")
# Try our best to get an UmbralPublicKey from input
alice_verifying_key = UmbralPublicKey.from_bytes(bytes(alice_verifying_key))
capsule = message_kit.capsule # TODO: generalize for WorkOrders with more than one capsule
hrac, map_id = self.construct_hrac_and_map_id(alice_verifying_key, label)
_unknown_ursulas, _known_ursulas, m = self.follow_treasure_map(map_id=map_id, block=True)
# Import Statements
# Core python imports
import datetime
import json
import os
import shutil
import base64
import msgpack
import maya
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact Form</title>
</head>
<body>
<script>
let $body = document.getElementsByTagName('body')[0];
// Calling Function from Above the function defination
Foo2();
var Foo2 = function (){
console.log("Inside Foo1");
}
// Calling Function from Below the function defination
Foo2();
// Calling Function from Above the function defination
Foo1();
function Foo1(){
console.log("Inside Foo1");
}
// Calling Function from Below the function defination
Foo1();