Skip to content

Instantly share code, notes, and snippets.

View chirag-chhajed's full-sized avatar
🎯
Focusing

Chirag Chhajed chirag-chhajed

🎯
Focusing
View GitHub Profile
import { useEffect, useState } from 'react'
import { LuCheck, LuChevronDown, LuLoaderCircle } from 'react-icons/lu'
import { cn } from '~/utils/tailwind'
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
@chirag-chhajed
chirag-chhajed / index.tsx
Last active January 5, 2025 13:28
Firebase Authentication in Expo: Complete Guide for Email & Google Sign-In
import React, { useEffect, useState } from "react";
import { View, Text, TextInput, Button, StyleSheet } from "react-native";
import auth from "@react-native-firebase/auth";
import { GoogleSignin } from "@react-native-google-signin/google-signin";
GoogleSignin.configure({
webClientId:
"<YOUR_GOOGLE_CLIENT_ID>",
scopes: ["profile", "email"],
});
@chirag-chhajed
chirag-chhajed / instructions.md
Created July 26, 2024 06:55
How to Install MySQL on a VM and Connect from Anywhere

How to Install MySQL on a VM and Connect from Anywhere

  1. Update package lists and install MySQL:

    sudo apt update && sudo apt install mysql-server
  2. Start MySQL service:

@chirag-chhajed
chirag-chhajed / azure_backup.sh
Created July 26, 2024 06:52
Sample bash script for Azure to take backups of your MySQL DB
#!/bin/bash
# Sample backup file
# Azure cli needs to be installed and configured first
# https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
# above link will help you to install and configure azure cli
# This script only works on the same machine where the MySQL server is running,
# If you want to use this script on a different machine, you need to also add the hostname and port to the mysqldump command
@chirag-chhajed
chirag-chhajed / aws_backup.sh
Created July 26, 2024 06:52
Sample bash script for AWS to take backups of your MySQL DB
#!/bin/bash
# Sample backup file
# aws cli needs to be installed first and configured
# https://sst.dev/chapters/create-an-iam-user.html
# above link will help you to create an IAM user and configure aws cli
# This script only works on the same machine where the MySQL server is running,
# If you want to use this script on a different machine, you need to also add the hostname and port to the mysqldump command
@chirag-chhajed
chirag-chhajed / aab.md
Created June 15, 2024 15:56
Expo APK/AAB Building Tutorial (No EAS Required)

Here's the list with the additional points:

  1. Ensure that you have OpenJDK 17, Android Studio, and its associated tools and NDK (Native Development Kit) installed on your system.

  2. Initialize a new Expo project by executing the following command in your terminal: pnpm create expo-app@latest. This command will prompt you to provide some details about your project, such as the project name and configuration options.

  3. Before building the Android app, you need to prebuild the android directory. Run the command pnpm expo prebuild to generate the necessary files. Additionally, you should provide your app's package name during this step. For example, if your app's package name is com.example.app.

  4. Generate a keystore file. Use an administrator shell to create the keystore. Run the following command: keytool -genkeypair -v -storetype PKCS12 -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000 and enter your password (store it safely somewhere) and details.

"use client";
import { useForm } from "react-hook-form";
import { valibotResolver } from "@hookform/resolvers/valibot";
import { object, string, toTrimmed, Output, email, minLength } from "valibot";
import Image from "next/image";
import Link from "next/link";
import {
Form,
FormControl,
#include <iostream>
using namespace std;
int main()
{
int x = 10;
// & returns the memory address of that variable.
cout << &x << endl;
// When used in a variable declaration, * denotes a pointer variable. For example:
import React,{useState} from "react"
export default function Form() {
const [formData, setFormData] = useState({
email: "",
password: "",
passwordConfirm: "",
joinedNewsletter: true
})