Skip to content

Instantly share code, notes, and snippets.

View eashish93's full-sized avatar

Ashish Rawat eashish93

View GitHub Profile
@eashish93
eashish93 / countries.ts
Last active February 3, 2023 07:43
Get countries with their flag.
// From : http://country.io/names.json, http://country.io/prefix.json
// Make sure to update it once in a while
const countries = [
{ name: 'Afghanistan', code: 'AF', prefix: '93' },
{ name: 'Aland Islands', code: 'AX', prefix: '35818' },
{ name: 'Albania', code: 'AL', prefix: '355' },
{ name: 'Algeria', code: 'DZ', prefix: '213' },
{ name: 'American Samoa', code: 'AS', prefix: '1684' },
{ name: 'Andorra', code: 'AD', prefix: '376' },
{ name: 'Angola', code: 'AO', prefix: '244' },
This file has been truncated, but you can view the full file.
@eashish93
eashish93 / frontend.ts
Created August 3, 2024 11:51
Parallel upload on R2 using S3 sdk with multipart (for large files)
// Define the type for upload parts
type UploadParts = {
ETag: string;
PartNumber: number;
};
// Function to create multipart upload
async function createMultipartUpload(file: File): Promise<{ uploadId: string; key: string }> {
const fileKey = `${crypto.randomUUID()}-${file.name}`;
Create dashboard using this exact prompt:
{
"prompt": "Build a modern dashboard UI named 'Angle' using React, Tailwind CSS, shadcn/ui components, @tabler/icons-react for icons, and recharts for charts, based on the provided visual reference.",
"details": {
"layout": {
"sidebar": {
"orientation": "vertical",
"brand": {
"icon": "IconHexagonLetterM", // Placeholder for the Mere logo, or a specific Tabler icon
"name": "Mere"