Skip to content

Instantly share code, notes, and snippets.

/* eslint-disable @typescript-eslint/no-explicit-any */
type DefaultValue<T> = T extends Function ? never : T extends object ? { [K in keyof T]: DefaultValue<T[K]> } : T;
export const createDefaultFormValues = <T extends Record<string, any>>(data?: T): DefaultValue<T> => {
if (!data) {
return {} as DefaultValue<T>;
}
const result: any = {};
@greatertomi
greatertomi / Login.tsx
Last active May 22, 2024 16:45
use formik better
import React, { useState } from 'react';
import { Image, Pressable, StyleSheet, View } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { useFormik } from 'formik';
import { CheckBox, LinkText, PasswordField, PrimaryButton, SecondaryButton, TextField } from '../../components';
import { Theme, useTheme } from '../../styles';
import { AuthContainer } from './AuthContainer';
import { ScreenDescription } from './ScreenDescription';
import { RootStackParamList } from '../../routes';
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
-- Insert faculties
INSERT INTO faculties (name) VALUES
('Faculty of Business and Management'),
('Faculty of Computer Science and Technology'),
('Faculty of Creative Arts and Design'),
('Faculty of Education'),
('Faculty of Environmental Studies'),
('Faculty of Social Sciences'),

Integration Guide

Authentication

When you send the email and password that tried logging in on your system to the login endpoint, you will receive a response with a token. This token is used to authenticate all other requests to the API. You should store this token in your application and send it as a header with every request.

const loginData = {
  email: 'test@example.com',
 password: 'abc123',
@greatertomi
greatertomi / Mac OS X: Open in Visual Studio Code
Created September 15, 2022 12:19 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@greatertomi
greatertomi / docker-help.md
Created January 16, 2021 17:08 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@greatertomi
greatertomi / gist:9d365083283fe13c92953d8b2cb9b1be
Created January 14, 2021 10:27 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
The list of banks in Nigeria
nigerianBanks = [
'Access Bank',
'Citibank',
'Diamond Bank',
'Dynamic Standard Bank',
'Ecobank Nigeria',
'Fidelity Bank Nigeria',
'First Bank of Nigeria',
import java.util.Scanner;
public class Solution {
static boolean isAnagram(String a, String b) {
// // once you declare a.toUppercase you should assign it to a. you cannot define it as just a.toUppercase...
// //I solved it with the long way however I could put a and b in a character array and then use Arrays.sort(arrayname). after this steps convert them to string and check if they are equel.
a=a.toUpperCase();
b=b.toUpperCase();
boolean ret = false;
StringBuilder c= new StringBuilder(b);