This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Luhn { | |
public static boolean isValid(String number) { | |
boolean isCardTypeValid = prefixMatched(number, "4") || prefixMatched(number, "5") || prefixMatched(number, "37") || prefixMatched(number, "6"); | |
if (!isCardTypeValid) { | |
return false; | |
} | |
int evenPlaceSum = sumOfDoubleEvenPlace(number); | |
int oddPlaceSum = sumOfOddPlace(number); | |
int totalSum = evenPlaceSum + oddPlaceSum; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function saveContacts() { | |
var contacts = document.querySelectorAll("._ccCW.FqYAR.i0jNr"); | |
for (var i = 0; i < contacts.length; i++) { | |
var contact_name = contacts[i].title; | |
if (contact_name[0] == "+" && unsaved_contacts.find(e => e == contact_name) == null) { | |
unsaved_contacts.push(contact_name); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import requests | |
from bs4 import BeautifulSoup | |
bot_token = "" | |
chat_id = "" | |
def get_coin_stats(coin): | |
r = requests.get(f"https://www.coingecko.com/en/coins/{coin.lower()}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import hashlib | |
import requests | |
class TypingDNA: | |
def __init__(self, apiKey, apiSecret): | |
self.apiKey = apiKey | |
self.apiSecret = apiSecret | |
self.base_url = "https://api.typingdna.com" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from faunadb import query as q | |
from faunadb.objects import Ref | |
from faunadb.client import FaunaClient | |
from faunadb.errors import BadRequest, Unauthorized | |
client = FaunaClient(secret="YOUR-SECRET-HERE") | |
def create_user(email, password): | |
result = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
def get_quotes(tag, page): | |
quotes = [] | |
r = requests.get(f"http://quotes.toscrape.com/tag/{tag}/page/{page}/") | |
if r.status_code == 200: | |
quotes_page = BeautifulSoup(r.text, "html.parser") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"9 payment service Bank": "120001", | |
"AB MICROFINANCE BANK": "090270", | |
"ABBEY MORTGAGE BANK": "070010", | |
"ABOVE ONLY MICROFINANCE BANK": "090260", | |
"ABU MICROFINANCE BANK": "090197", | |
"ACCESS BANK": "000014", | |
"ACCESSMONEY": "100013", | |
"ACCION MFB": "090134", | |
"ADDOSSER MFBB": "090160", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import random | |
import smtplib | |
import ssl | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
host = "" | |
port = 465 | |
sender = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tronapi import Tron | |
full_node = "https://api.trongrid.io" | |
solidity_node = "https://api.trongrid.io" | |
event_server = "https://api.trongrid.io" | |
tron = Tron(full_node=full_node, solidity_node=solidity_node, | |
event_server=event_server) | |
tron.private_key = "SECRET KEY" | |
tron.default_address = tron.address.from_private_key(tron.private_key).base58 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from paystackapi.paystack import Paystack | |
from paystackapi.trecipient import TransferRecipient | |
from paystackapi.tcontrol import TransferControl | |
from paystackapi.verification import Verification | |
from paystackapi.transfer import Transfer | |
paystack_secret_key = "" | |
paystack = Paystack(secret_key=paystack_secret_key) | |