Skip to content

Instantly share code, notes, and snippets.

View RayanAbid's full-sized avatar
🦜
Focusing

Rayan Abid RayanAbid

🦜
Focusing
View GitHub Profile
@RayanAbid
RayanAbid / command bash
Created March 24, 2024 15:01
Command to get sha key android
keytool -list -v -alias androiddebugkey -keystore ./android/app/debug.keystore -storepass android -keypass android
@RayanAbid
RayanAbid / tailwind.config.js
Created February 20, 2024 16:42
Tailwind css config file
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
],
purge: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"],
theme: {
screens: {
xs: "10px",
sm: "640px",
@RayanAbid
RayanAbid / FirebaseImageUpload.js
Created April 15, 2023 16:04
this is an image upload component using expo, firebase ver 9,
import React, { useState, useEffect } from "react";
import { Button, Image, View, Platform, ActivityIndicator } from "react-native";
import * as ImagePicker from "expo-image-picker";
import { auth, storage, firebase, db } from "../utils/firebase";
import {
getStorage,
ref,
uploadBytesResumable,
getDownloadURL,
} from "firebase/storage";
@RayanAbid
RayanAbid / firebase.js
Last active March 19, 2023 17:33
Some useful firebase function that I use regularly
// Import the functions you need from the SDKs you need
import * as firebase from "firebase";
import "firebase/auth";
import "firebase/firestore";
// import "firebase/auth";
// import "firebase/analytics";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
@RayanAbid
RayanAbid / portCheck
Created March 13, 2023 09:32
Checks what is runnig on port
sudo netstat -tulnp | grep :80
@RayanAbid
RayanAbid / GetCountryCode.json
Last active December 16, 2022 19:32
A JSON file that you can use to get country code by using country name.
[
{
"Afghanistan": "AF",
"Åland Islands": "AX",
"Albania": "AL",
"Algeria": "DZ",
"American Samoa": "AS",
"AndorrA": "AD",
"Angola": "AO",
"Anguilla": "AI",
@RayanAbid
RayanAbid / RemoveObj.js
Created November 28, 2022 17:39
Removes a specific index from an array of objects
// Array
const arr = [{id: "1", name: "Toby"}, {id: "2", name: "John"} ]
//remove item
const itemToBeRemoved = { id: "1", name: "Toby" };
// Function to rem item
arr.splice(
arr.findIndex((a) => a.id === itemToBeRemoved._id),
1
@RayanAbid
RayanAbid / uniqueArr.js
Created November 21, 2022 16:00
A js function that removes the value if exists and adds it if new
const arr = YOUR_ARRAY
const newId = YOUR_NEW_ID; //new id
if (!arr?.includes(newId)) {
console.log("add now");
arr?.push(newId); //adding to array because value doesnt exists
} else {
console.log("rem now");
@RayanAbid
RayanAbid / Code.gs
Last active October 29, 2022 18:33 — forked from AhsanAyaz/Code.gs
Email automation App Script ( send email with aliases script )
/**
Replace the "<DOCID>" with your document ID, or the entire URL per say. Should be something like:
var EMAIL_TEMPLATE_DOC_URL = 'https://docs.google.com/document/d/asdasdakvJZasdasd3nR8kmbiphqlykM-zxcrasdasdad/edit?usp=sharing';
*/
var EMAIL_TEMPLATE_DOC_URL = 'https://docs.google.com/document/d/<DOCID>/edit?usp=sharing';
var EMAIL_SUBJECT = 'This is an important email';
/**
* Sends a customized email for every response on a form.