Skip to content

Instantly share code, notes, and snippets.

View onedebos's full-sized avatar

Adebola Adeniran onedebos

View GitHub Profile
@onedebos
onedebos / UKSA document list.json
Created August 4, 2025 14:21
Document requirements for Schengen visa in the UK
const VISA_REQUIREMENTS = {
austria: "",
belgium: "",
"czech republic": "",
denmark:
"https://storbritannien.um.dk/en/travel-and-residence/how-to-apply-for-a-visa/visa-checklists",
estonia: "",
finland: "",
france: "",
germany: "",
@onedebos
onedebos / App.js
Last active February 24, 2025 13:46
import React, { useState, useEffect } from "react";
import axios from "axios";
const App = () => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [user, setUser] = useState();
useEffect(() => {
const loggedInUser = localStorage.getItem("user");
@onedebos
onedebos / App.jsx
Last active July 21, 2023 10:47
How to implement a load more button in React
import React, { useState, useEffect } from "react";
import Posts from "./Posts";
import posts from "./postsArray";
const postsPerPage = 3;
let arrayForHoldingPosts = [];
const App = () => {
const [postsToShow, setPostsToShow] = useState([]);
const [next, setNext] = useState(3);
// pages/login.js
import { useCookies } from "react-cookie"
const Login = () => {
const [cookie, setCookie] = useCookies(["user"])
const handleSignIn = async () => {
try {
const response = await yourLoginFunction(username) //handle API call to sign in here.
const data = response.data
setCookie("user", JSON.stringify(data), {
path: "/",
@onedebos
onedebos / adebola-cv.md
Last active March 17, 2022 23:09
Resume for Adebola Adeniran
import Footer from '../../components/Footer';
import axios from 'axios';
import parse from 'html-react-parser';
import { getAuthor, getFeaturedImage } from '../../lib/utils';
import { POSTS_API_URL } from '../../lib/constants';
import Head from 'next/head';
import styles from '../../styles/Post.module.css';
export default function Post({ title, featuredImg, author, content, date }) {
return (
<div className="flex flex-col items-center justify-center min-h-screen">
import Footer from '../../components/Footer';
import axios from 'axios';
import { getAuthor, getFeaturedImage } from '../../lib/utils';
import { POSTS_API_URL } from '../../lib/constants';
export default function Post({ title, featuredImg, author, content, date }) {
return (
<div className="flex flex-col items-center justify-center min-h-screen">
</div>
import Link from 'next/link';
import { useState, useEffect } from 'react';
import { getAuthor, getFeaturedImage } from '../lib/utils';
import parse from 'html-react-parser';
export default function Post({ post }) {
const [postImgAndAuthor, setPostImgAndAuthor] = useState({ featImgUrl: '', author: '' });
useEffect(() => {
let mounted = true;
if (mounted) {
const author = getAuthor(post.author);
import Head from 'next/head';
import Post from '../components/Post';
import Footer from '../components/Footer';
import { useState, useEffect } from 'react';
import { getAllPostsFromServer } from '../lib/utils';
export default function Home() {
const [posts, setPosts] = useState([]);
useEffect(async () => {
@onedebos
onedebos / utils.js
Created April 28, 2021 22:56
methods that handle getting the post, author and featured image from our server
import axios from 'axios';
import { POSTS_API_URL, AUTHORS_API_URL, MEDIA_API_URL } from './constants';
export const getAllPostsFromServer = async () => {
// get all posts from Server
try {
const { data } = await axios.get(POSTS_API_URL);
return data;
} catch (error) {