mirror of
https://github.com/Snigdha-OS/Snigdha-OS.github.io.git
synced 2025-09-17 10:05:03 +02:00
🧹 chore(clean): whole repository
This commit is contained in:
@@ -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);
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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,
|
||||
};
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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`;
|
||||
}
|
Reference in New Issue
Block a user