🧹 chore(clean): whole repository

This commit is contained in:
eshanized
2024-12-25 04:57:02 +05:30
parent 9333bebc52
commit 2340d0f691
88 changed files with 0 additions and 10238 deletions

View File

@@ -1,8 +0,0 @@
export function formatINR(amount: number) {
return new Intl.NumberFormat('en-IN', {
style: 'currency',
currency: 'INR',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}).format(amount);
}

View File

@@ -1,57 +0,0 @@
const GITHUB_API_URL = 'https://api.github.com';
export interface GithubUser {
login: string;
name: string | null;
avatar_url: string;
html_url: string;
bio: string | null;
public_repos: number;
followers: number;
location: string | null;
}
export interface GithubRepo {
id: number;
name: string;
description: string;
html_url: string;
stargazers_count: number;
forks_count: number;
language: string;
updated_at: string;
}
export async function fetchGithubUser(username: string): Promise<GithubUser> {
try {
const response = await fetch(`${GITHUB_API_URL}/users/${username}`);
if (!response.ok) {
const errorData = await response.json().catch(() => ({}));
console.error(`GitHub API Error (${response.status}):`, errorData);
throw new Error(`Failed to fetch user ${username}: ${response.statusText}`);
}
return await response.json();
} catch (error) {
console.error(`Error fetching GitHub user ${username}:`, error);
throw error;
}
}
export async function fetchOrgRepos(org: string): Promise<GithubRepo[]> {
try {
const response = await fetch(`${GITHUB_API_URL}/orgs/${org}/repos?sort=updated&per_page=100`);
if (!response.ok) {
const errorData = await response.json().catch(() => ({}));
console.error(`GitHub API Error (${response.status}):`, errorData);
throw new Error(`Failed to fetch repositories: ${response.statusText}`);
}
return await response.json();
} catch (error) {
console.error('Error fetching repositories:', error);
throw error;
}
}

View File

@@ -1,18 +0,0 @@
export interface UserLocation {
country: string;
city: string;
continent: string;
}
export async function getUserLocation(): Promise<UserLocation> {
const response = await fetch('https://ipapi.co/json/');
if (!response.ok) {
throw new Error('Failed to fetch location');
}
const data = await response.json();
return {
country: data.country_name,
city: data.city,
continent: data.continent_code,
};
}

View File

@@ -1,18 +0,0 @@
export async function measureNetworkSpeed(): Promise<number> {
const startTime = performance.now();
const response = await fetch('https://www.cloudflare.com/cdn-cgi/trace', { cache: 'no-store' });
const endTime = performance.now();
const duration = endTime - startTime;
if (!response.ok) {
throw new Error('Failed to measure network speed');
}
const data = await response.text();
const size = new Blob([data]).size;
// Calculate speed in Mbps (megabits per second)
const speedMbps = (size * 8) / (duration / 1000) / 1000000;
return Math.round(speedMbps * 100) / 100;
}

View File

@@ -1,18 +0,0 @@
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function formatDate(date: string) {
return new Date(date).toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
year: 'numeric',
});
}
export function formatSpeed(speed: number) {
return `${speed} Mbps`;
}