Skip to content

Instantly share code, notes, and snippets.

View azeezat's full-sized avatar

Azeezat Raheem azeezat

View GitHub Profile
'use client';
import React from 'react';
import { Form } from 'radix-ui';
import { Flex } from '@radix-ui/themes';
import {
RequestCategory,
RequestInput,
} from '@/backend/graphql/generated/types.generated';
import { SearchableDropdown } from '@/frontend/components/dropdown/searchable-dropdown';
import { FileUpload } from './upload-file';
@azeezat
azeezat / RequestPage.ts
Last active January 9, 2026 16:09
the logical part of the create request page
'use client';
import React, { useState } from 'react';
import { DialogComponent } from '@/frontend/components/dialog/dialog';
import { Form } from 'radix-ui';
import {
FileUploadInput,
MutationcreateRequestArgs,
Request,
RequestCategory,
RequestInput,
import React, { useEffect, useMemo, useReducer } from "react";
import {
setItemInLocalStorage,
getUserDetailsFromStorage,
clearLocalStorage,
} from "../../helpers";
import { USER_TOKEN } from "../../constants";
import { AuthContext, initialAuthState } from "./AuthContext";
import { useActivityContext } from "../activity/ActivityContext";
import { userReducer } from "../../reducers";
import { createContext, useContext } from "react";
export const initialAuthState = {
isLoggedIn: false,
};
export const AuthContext = createContext({
user: initialAuthState,
updateUserContext: () => {},
clearUserContext: () => {},
import ProtectedRoutes from "../routes/ProtectedRoutes";
function MyApp({ Component, pageProps,router }) {
return (
<ProtectedRoutes router={router}>
<Component {...pageProps} />
</ProtectedRoutes>
)
}
const ProtectedRoute = ({ router, children }) => {
return children;
};
export default ProtectedRoute;
import { appRoutes } from "../constants";
import { useAuthContext } from "../contexts";
const ProtectedRoute = ({ router, children }) => {
//Identify authenticated user
const { user } = useAuthContext();
const isAuthenticated = user.isLoggedIn;
let unprotectedRoutes = [
import { appRoutes } from "../constants";
import { useAuthContext } from "../contexts";
//check if you are on the client (browser) or server
const isBrowser = () => typeof window !== "undefined";
const ProtectedRoute = ({ router, children }) => {
//Identify authenticated user
const { user } = useAuthContext();
const isAuthenticated = user.isLoggedIn;
import pandas as pd
# to read just one sheet to dataframe:
A = pd.read_excel(file_name, sheetname="sheet1")
B = pd.read_excel(file_name, sheetname="sheet2")
print(A.columns)
print(B.columns)
Output:
@azeezat
azeezat / Regex.java
Last active March 20, 2020 13:29
Regex in Java
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.ArrayList;
import java.util.List;
class RegexExample
{
public static void main(String args[])
{
//An array list to create a list of emails