Skip to content

Instantly share code, notes, and snippets.

View geraldPhiri's full-sized avatar

Gerald Phiri geraldPhiri

  • Gotech
  • Ndola, Zambia
View GitHub Profile
@geraldPhiri
geraldPhiri / pcsbuy.js
Created June 15, 2022 13:17 — forked from adityawarmanfw/pcsbuy.js
PancakeSwap SwapExactETHForTokens
const ethers = require('ethers');
const prompt = require('prompt-sync')({sigint: true});
const addresses = {
WBNB: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
router: "0x10ed43c718714eb63d5aa57b78b54704e256024e",
target: "0x8129686c77E63C22bE6a7F06F9C61f135BD0a0CF" // Change this to your address ELSE YOU GONNA SEND YOUR BEANS TO ME
}
const BNBAmount = ethers.utils.parseEther('0.1').toHexString();
@geraldPhiri
geraldPhiri / .deps...remix-tests...remix_accounts.sol
Created March 31, 2022 15:47
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.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;
@geraldPhiri
geraldPhiri / Android: get CountryCode from TelephonyManager
Created September 4, 2019 02:21 — forked from xingstarx/Android: get CountryCode from TelephonyManager
Android: Get CountryCode and Locale from TelephonyManager
public static int getCurrentCountryCode(Context context) {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String countryIso = telephonyManager.getSimCountryIso().toUpperCase();
return PhoneNumberUtil.getInstance().getCountryCodeForRegion(countryIso);
}
PhoneNumberUtil 引用自
compile 'com.googlecode.libphonenumber:libphonenumber:8.3.1'