This file contains 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
# importing the library | |
from covid import Covid | |
# initializing | |
covid = Covid() | |
# printing data for the world | |
print("Total active cases in world:", covid.get_total_active_cases()) | |
print("Total recovered cases in world:", covid.get_total_recovered()) | |
print("Total deaths in world:", covid.get_total_deaths()) | |
# getting data according to country wise | |
cases = covid.get_status_by_country_name("us") |
This file contains 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
// Implementation in ES6 | |
function pagination(c, m) { | |
var current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, | |
range = [], | |
rangeWithDots = [], | |
l; |
Pentesting-Exploitation Programs and Commands , Protocols Network / Ports
This file contains 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 importlib | |
def get_class_from_module(module_class): | |
"""Get Class from a module""" | |
module_name, class_name = module_class.rsplit('.', 1) | |
return getattr(importlib.import_module(module_name), class_name) |
This file contains 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 django.db import models | |
from django.utils.translation import pgettext_lazy | |
from utility.models import BaseModel, BaseModelAdmin | |
class Continent(BaseModel): | |
name = models.CharField(max_length=255, | |
primary_key=True, | |
verbose_name=pgettext_lazy('Continent', |
This file contains 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
def nth_fibonacci(n): | |
a = 0 | |
b = 1 | |
if n < 0: | |
print("Incorrect input") | |
elif n == 0: | |
return a | |
elif n == 1: | |
return b | |
else: |
This file contains 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 datetime import datetime, timedelta | |
from typing import Any, Union | |
from jose import jwt | |
from passlib.context import CryptContext | |
from core.config import settings | |
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") |
This file contains 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
name: Upload Python Package | |
on: | |
release: | |
types: [created] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest |
This file contains 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 typing | |
import hashlib | |
from binascii import b2a_hex, a2b_hex | |
import bcrypt | |
from Crypto.Cipher import AES | |
class AesCrypto: | |
def __init__(self, key: str, key_length: int = 16): |
OlderNewer