Skip to content

Instantly share code, notes, and snippets.

View vyomshm's full-sized avatar
😇
Building @0xSyndr !!

Vyom vyomshm

😇
Building @0xSyndr !!
View GitHub Profile
@vyomshm
vyomshm / Multisig.sol
Created December 26, 2021 13:03 — forked from z0r0z/Multisig.sol
Simple gas-optimized multi-signature contract.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Simple gas-optimized multi-signature contract.
contract Multisig {
event Propose(address indexed proposer, uint256 indexed proposal);
event Sign(address indexed signer, uint256 indexed proposal);
event Execute(uint256 indexed proposal);
error NotSigner();
@vyomshm
vyomshm / mac-setup-redis.md
Created August 18, 2021 08:36 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@vyomshm
vyomshm / debugger pause beforeunload
Created June 10, 2021 08:34 — forked from carcinocron/debugger pause beforeunload
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@vyomshm
vyomshm / index.js
Created May 18, 2021 18:44 — forked from amiantos/index.js
Zip Multiple Files from S3 using AWS Lambda Function
// Lambda S3 Zipper
// http://amiantos.net/zip-multiple-files-on-aws-s3/
//
// Accepts a bundle of data in the format...
// {
// "bucket": "your-bucket",
// "destination_key": "zips/test.zip",
// "files": [
// {
// "uri": "...", (options: S3 file key or URL)
@vyomshm
vyomshm / CompactMemoryProofsMock.sol
Created March 27, 2019 19:20
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.5.2+commit.1df8f40c.js&optimize=false&gist=
pragma solidity 0.5.2;
pragma experimental ABIEncoderV2;
import {EthereumRuntime} from "./EthereumRuntime.sol";
import {EVMMemory} from "./EVMMemory.slb";
import {MerkleProof} from "./MerkleProof.slb";
contract CompactMemoryProofsMock {
using EVMMemory for EVMMemory.Memory;
contract Contract {
function main() {
memory[0x40:0x60] = 0x80;
if(msg.data.length < 0x04) { revert(memory[0x00:0x00]); }
var var0 = msg.data[0x00:0x20] / 0x0100000000000000000000000000000000000000000000000000000000;
if(var0 == 0x025e7c27) {
var var1 = msg.value;
@vyomshm
vyomshm / ConditionalTradeEscrow.sol
Created December 23, 2018 20:10
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.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.25;
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/payment/escrow/ConditionalEscrow.sol";
contract ConditionalTradeEscrow is ConditionalEscrow{
uint private _nConditions;
mapping(address => uint) private _buyerConditions;
bool private _sellerApproval;
constructor(uint _n) public{
import numpy as np
from data_prep import features, targets, features_test, targets_test
np.random.seed(42)
def sigmoid(x):
"""
Calculate sigmoid
"""
return 1 / (1 + np.exp(-x))
import numpy as np
def sigmoid(x):
"""
Calculate sigmoid
"""
return 1 / (1 + np.exp(-x))
import numpy as np
def sigmoid(x):
"""
Calculate sigmoid
"""
return 1 / (1 + np.exp(-x))