Skip to content

Instantly share code, notes, and snippets.

View satyambnsal's full-sized avatar
🏠
remote work🤟

Satyam Bansal satyambnsal

🏠
remote work🤟
View GitHub Profile
import { assignDiscordRole } from '../../utils/discord.js';
import example_circuit from '../../shared/example_circuit.json' with { type: 'json' };
import { UltraHonkBackend } from '@aztec/bb.js';
const backend = new UltraHonkBackend(example_circuit.bytecode);
export default async function discordRoutes(fastify) {
fastify.route({
method: 'POST',
@satyambnsal
satyambnsal / gist:ead5fa5134bf953162c7195d83980a41
Created January 27, 2025 06:19
tileville-procedural-generation-map
import { HexGrid } from "./HexGrid";
import { Hex } from "./Hex";
import { Matrix2D } from "../util";
interface MapConfig {
size: number;
theme: MapTheme;
difficulty: number;
features: MapFeatures;
}
{
transaction:
'{"feePayer":{"body":{"publicKey":"B62qm8YHJAvZit7qRXwvmVTLsAwsX5GjRZ7APAtLmQZiPVAB5LjMdf8","fee":"100000000","validUntil":null,"nonce":"10"},"authorization":"7mWxjLYgbJUkZNcGouvhVj5tJ8yu9hoexb9ntvPK8t5LHqzmrL6QJjjKtf5SgmxB4QWkDw7qoMMbbNGtHVpsbJHPyTy2EzRQ"},"accountUpdates":[{"body":{"publicKey":"B62qs2NthDuxAT94tTFg6MtuaP1gaBxTZyNv9D3uQiQciy1VsaimNFT","tokenId":"wSHV2S4qX9jFsLjQo8r1BsMLH2ZRKsZx6EJd1sbozGPieEC4Jf","update":{"appState":[null,null,null,null,null,null,null,null],"delegate":null,"verificationKey":null,"permissions":null,"zkappUri":null,"tokenSymbol":null,"timing":null,"votingFor":null},"balanceChange":{"magnitude":"0","sgn":"Positive"},"incrementNonce":false,"events":[["2","116061048837531722551099048644889289986486862114220372","12734247283082517782182378308377226560174176991545248296599550711913059465986","0","24157098283612104140600617543129141372403717057837862439633945511216398195023","1","0","8161054844798290198029438477645468625607270933885159334286498488969715994219",
@satyambnsal
satyambnsal / Voting.sol
Created July 15, 2024 08:40
Voting Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Voting {
struct Candidate {
string name;
uint256 voteCount;
}
Candidate[] public candidates;
@satyambnsal
satyambnsal / README.txt
Created July 28, 2021 11:05
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=builtin&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@satyambnsal
satyambnsal / README.txt
Created July 28, 2021 11:05
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=builtin&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@satyambnsal
satyambnsal / package.json
Created November 18, 2020 17:32 — forked from kentcdodds/package.json
setup script for my workshops
{
"name": "workshop-setup",
"version": "1.0.0",
"description": "This is the common setup script for most of my workshops",
"bin": "./setup.js"
}
@satyambnsal
satyambnsal / package.json
Created October 3, 2018 19:15
Sample package.json file for Javascript developers
{
"name": "service name",
"version": "1.0.0",
"main": "src/index.js",
"engines": {
"node": ">=8.9.1"
},
"scripts": {
"start": "node src/index.js",
"lint": "eslint --fix ."
@satyambnsal
satyambnsal / .eslintrc.js
Created October 3, 2018 18:55
ESLInt rules for javascript developers
module.exports = {
env: {
browser: true,
node: true,
es6: true
},
extends: ['eslint:recommended', 'plugin:node/recommended'],
parserOptions: {
ecmaVersion: 2017,
ecmaFeatures: {
1.GraphQL