Skip to content

Instantly share code, notes, and snippets.

View idimetrix's full-sized avatar
Big believer in quality over quantity. Maximization through minimization.

Dmitry Selikhov idimetrix

Big believer in quality over quantity. Maximization through minimization.
View GitHub Profile
@idimetrix
idimetrix / BEP-20-wallet.ts
Created May 27, 2023 00:15
BEP-20 wallet
import Web3 from 'web3'; // Import the Web3 library
import HDWalletProvider from '@truffle/hdwallet-provider'; // Import the HDWalletProvider
const mnemonic = 'your-mnemonic-here'; // Replace with your actual mnemonic
const providerUrl = 'https://bsc-dataseed.binance.org'; // Replace with your desired network
const contractAddress = '0xcontract-address'; // Replace with the address of the BEP-20 token contract
const web3 = new Web3(new HDWalletProvider(mnemonic, providerUrl)); // Create a new instance of Web3 with the specified provider
interface Transaction {
@wickkidd
wickkidd / TimeCop.java
Created January 6, 2020 17:30
TimeCop::freezeDuring static method that freezes time during the execution of the passed lambda (Runnable). Idea stolen from my days as a ruby dev https://github.com/travisjeffery/timecop
package my.awesome.namespace;
import org.joda.time.DateTime;
import org.joda.time.DateTimeUtils;
public class TimeCop {
public static void freezeDuring(Runnable block) {
DateTimeUtils.setCurrentMillisFixed(DateTime.now().getMillis());
block.run();