Skip to content

Instantly share code, notes, and snippets.

View sumitpatel93's full-sized avatar

QuantumWidget sumitpatel93

  • Noida
  • 20:38 (UTC -12:00)
View GitHub Profile
@gorgos
gorgos / BalancerExample.sol
Last active October 31, 2021 01:37
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.2+commit.51b20bc0.js&optimize=true&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.7.2;
interface PoolInterface {
function swapExactAmountIn(address, uint, address, uint, uint) external returns (uint, uint);
function swapExactAmountOut(address, uint, address, uint, uint) external returns (uint, uint);
}
interface TokenInterface {
function balanceOf(address) external returns (uint);
@gnidan
gnidan / allocation-storage.md
Last active November 18, 2023 02:19
solidity allocation examples

storing things with solidity for fun and confusion

uint64[] with 9 elements

storing [ 10, 11, 12, 13, 14, 15, 16, 17, 18 ]:

   ...
@rosario
rosario / composing-software.md
Created January 17, 2018 16:13 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
NodeJS Chaincode Deploy and Test
start Docker
cd /fabric-samples/basic-network /basic network
Edit docker-compose.yml change line no 72 comment and 73 uncomment. //prod to devp network
Edit start.sh add ‘cli’ in 15 no. line (docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb cli)
./start.sh //run start script to up network
docker logs -f peer0.org1.example.com //log (1 terminal)
docker exec -it cli bash //peer (2 terminal)
cd /fabric-samples/chaincode/hyperledger/fabric/peer/nodefiles (3 terminal)
/**
* Sample access control list.
*/
rule EverybodyCanReadEverything {
description: "Allow all participants read access to all resources"
participant: "org.acme.sample.User"
operation: READ
resource: "org.acme.sample.*"
action: ALLOW
}
@iamatypeofwalrus
iamatypeofwalrus / roll_ipython_in_aws.md
Last active January 22, 2024 11:18
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time