Skip to content

Instantly share code, notes, and snippets.

View Kavan72's full-sized avatar
🦊

Hidan Kavan72

🦊
  • DeftBOX Solutions
  • Ahmedabad, Gujarat, India
View GitHub Profile
@Kavan72
Kavan72 / index.mjs
Last active July 3, 2023 06:31
Static Next.js serve on s3 with CloudFront
import { S3Client, GetObjectCommand } from '@aws-sdk/client-s3'
const TTL = 10000
const S3_REGION = '' // Update this with your s3 region
const S3_BUCKET_NAME = '' // Update this with your s3 bucket name
const S3_FILE_PATH = 'routes-manifest.json'
const s3 = new S3Client({ region: S3_REGION })
const s3Params = {
Bucket: S3_BUCKET_NAME,
{
"LastApplication": "2020-04-27T05:05:36.940814+00:00",
"Collapsed": {
"ARES_MOC_ENTITLEMENT": "urn:entitlement:arestencent.ares.moc",
"CLIENT.ICONS.ENABLED": "true",
"CLIENT_LEADERBOARDS_ENABLED": "false",
"GAME_ALLOW_CONSOLE": "true",
"GAME_ALLOW_DEVELOPER_MENU": "true",
"GAME_DISABLED_DEATHCAM": "true",
"GAME_DISABLED_SKINS_WEAPONS": "{B96ABFD9-4E1C-55AD-B685-8A88427C7404},{86F7362A-4649-892D-1A76-2FB3F1E9F2D2},{AD699809-4C07-85F8-BF94-749ABE92D531}",
@Kavan72
Kavan72 / README.md
Created June 12, 2021 12:44
How to fetch Valorant user inventory?

How to fetch valorant user inventory(in python)?

There is no endpoint available to fetch inventory. Wait a second ? how does the game fetch user skins, player_cards, buddy, etc? So, After digging into Valorant I found the user inventory.

I created down below a basic python code that fetches the Valorant user inventory.

import request
@Kavan72
Kavan72 / endpoints.txt
Last active June 20, 2024 11:32
Valorant endpoints
[PlayerFeedback_CheckForSurvey] POST
[PlayerFeedback_SendAnswers] POST
[PatchNotes_GetPatchNotes] GET
[AggStats_Fetch] GET
[AccountXP_GetPlayer] GET https://pd.ap.a.pvp.net/account-xp/v1/players/{user_id}
[Config_FetchConfig] GET https://shared.ap.a.pvp.net/v1/config/ap
@Kavan72
Kavan72 / example.py
Created April 28, 2021 18:49 — forked from wshayes/example.py
[Repeat every] Example FastAPI code to run a function every X seconds #fastapi
# Copied from code shared on Gitter (https://gitter.im/tiangolo/fastapi) by @dmontagu
# Decorator for fastapi
def repeat_every(*, seconds: float, wait_first: bool = False):
def decorator(func: Callable[[], Optional[Awaitable[None]]]):
is_coroutine = asyncio.iscoroutinefunction(func)
@wraps(func)
async def wrapped():
async def loop():
if wait_first:
@Kavan72
Kavan72 / port-forwarding.py
Created May 16, 2020 21:18 — forked from WangYihang/port-forwarding.py
port forwarding via python socket
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Tcp Port Forwarding (Reverse Proxy)
# Author : WangYihang <wangyihanger@gmail.com>
import socket
import threading
import sys
@Kavan72
Kavan72 / xpath.js
Created February 6, 2020 07:23 — forked from beatngu13/xpath.js
Get the absolute XPath for a given Selenium WebElement
// Taken from https://stackoverflow.com/a/47088726/3429133.
function getAbsoluteXPath(element) {
var comp, comps = [];
var parent = null;
var xpath = '';
var getPos = function(element) {
var position = 1,
curNode;
if (element.nodeType == Node.ATTRIBUTE_NODE) {
return null;
@Kavan72
Kavan72 / download.py
Created October 1, 2019 10:59 — forked from khardix/download.py
Python AsyncIO/aiohttp downloader with progressbars
#!/usr/bin/env python3.6
import asyncio
from contextlib import closing
import aiohttp
import tqdm
async def download(session, url, progress_queue):