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 random | |
from typing import Tuple | |
def get_reciprocal(value: int, mod: int) -> int: | |
for i in range(1, mod): | |
if (i * value) % mod == 1: | |
return i | |
return -1 |
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
const circomlib = require("circomlib"); | |
const mimcsponge = circomlib.mimcsponge; | |
export function MiMCSponge(left: string, right: string): string { | |
return mimcsponge.multiHash([BigInt(left), BigInt(right)]).toString(); | |
} | |
export interface IMerkleTree { | |
root: () => string; | |
proof: (index: number) => { |
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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity 0.8.14; | |
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/proxy/beacon/BeaconProxy.sol"; | |
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/proxy/beacon/UpgradeableBeacon.sol"; | |
import {ImplementationV1, ImplementationV2} from "./Implementation.sol"; | |
contract Setup { | |
address immutable public proxy1; | |
address immutable public proxy2; |
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
REMIX DEFAULT WORKSPACE | |
Remix default workspace is present when: | |
i. Remix loads for the very first time | |
ii. A new workspace is created | |
iii. There are no files existing in the File Explorer | |
This workspace contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. |
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
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol) | |
pragma solidity ^0.8.0; | |
import "./IERC20.sol"; | |
import "./extensions/IERC20Metadata.sol"; | |
import "../../utils/Context.sol"; | |
/** |
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
<input type="file" /> |
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 React, { useState, useEffect } from "react"; | |
import "./styles.css"; | |
export default function App() { | |
const [sum, setSum] = useState(0); | |
useEffect(() => { | |
const worker = new Worker("./computing.js"); | |
worker.addEventListener("message", (e) => { | |
const data = e.data; |
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
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md | |
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192 | |
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB. | |
------------ | |
-- Basics -- | |
------------ | |
-- Get indexes of tables |
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
let servers = null | |
let pcConstraint = null | |
let dataConstraint = null | |
const localConnection = new RTCPeerConnection(null) | |
const remoteConnection = new RTCPeerConnection(null) | |
const dataChannel = localConnection.createDataChannel('chat', { | |
negotiated: true, | |
id: 0 | |
}) | |
const dataChannel2 = remoteConnection.createDataChannel('chat', { |
NewerOlder