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 / 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'