Skip to content

Instantly share code, notes, and snippets.

View 10dimensions's full-sized avatar
🎯
Focusing

10dimensions

🎯
Focusing
  • Bangalore, India
View GitHub Profile
@10dimensions
10dimensions / UniV2SwapIndexer.js
Created July 7, 2023 16:44
Simple UniswapV2 Event Indexer
const ethers = require("ethers");
const provider = new ethers.providers.WebSocketProvider(
"wss://mainnet.infura.io/ws/v3/<RPC-KEY-HERE>"
)
const swapHistory = {}
filter = {
address: ["0xE1De07566cEb19D2e45B60B491776aB74C9b8d7A"], //token address
@10dimensions
10dimensions / scripts...deploy_with_ethers.ts
Created December 5, 2022 16:01
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// This script can be used to deploy the "Storage" contract using ethers.js library.
// Please make sure to compile "./contracts/1_Storage.sol" file before running this script.
// And use Right click -> "Run" from context menu of the file to run the script. Shortcut: Ctrl+Shift+S
import { deploy } from './ethers-lib'
(async () => {
try {
const result = await deploy('Storage', [])
console.log(`address: ${result.address}`)
@10dimensions
10dimensions / INRC.sol
Created July 26, 2022 04:46
INR Stable Coin, Pegged to USDC at a static exchange rate
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
@10dimensions
10dimensions / INRC_compiled.sol
Created July 21, 2022 18:28
INRC Stable Coin, Pegged to USDC at constant exchange rate
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
@10dimensions
10dimensions / contracts...Bundles.sol
Created February 25, 2022 13:17
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Counters.sol";
import "contracts/utils.sol";
contract Bundle is ERC721Full {
using Counters for Counters.Counter;
@10dimensions
10dimensions / Nft_mint_airdrop.sol
Created February 10, 2022 14:36
mint and airdrop ERC721 tokens
//Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/token/ERC721/ERC721Upgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/utils/CountersUpgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/access/OwnableUpgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/proxy/utils/Initializable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/utils/ContextUpgradeable.sol";
@10dimensions
10dimensions / aws-amplify-configure.js
Created July 10, 2021 14:57 — forked from praveen001/aws-amplify-configure.js
Passwordless Phone number authentication using AWS Amplify and Cognito
import Amplify, { Auth } from 'aws-amplify';
Amplify.configure({
Auth: {
region: 'us-east-1',
userPoolId: '**********',
userPoolWebClientId: '******************',
}
});
@10dimensions
10dimensions / fill_depth_colorization.py
Created January 5, 2021 15:20 — forked from ialhashim/fill_depth_colorization.py
Python implementation of depth filling from NYU Depth v2 toolbox
# Original Matlab code https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html
#
#
# Python port of depth filling code from NYU toolbox
# Speed needs to be improved
#
# Uses 'pypardiso' solver
#
import scipy
import skimage
/*
* @author vishal / https://github.com/10dimensions
* @author zz85 / https://github.com/zz85
* @author mrdoob / http://mrdoob.com
* Running this will allow you to drag three.js objects around the screen.
*/
import {
Camera,
EventDispatcher,
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO.Ports;
using System;
using System.Threading;
public class SerialPortComm : MonoBehaviour
{
public static SerialPortComm Instance;