Skip to content

Instantly share code, notes, and snippets.

View Origho-precious's full-sized avatar
⚒️
Learning & Building

Precious Origho Origho-precious

⚒️
Learning & Building
View GitHub Profile
import path from "path";
import { promises as fs } from "fs";
import process from "process";
import dotenv from "dotenv";
import { google, Auth } from "googleapis";
import { authenticate } from "@google-cloud/local-auth";
dotenv.config();
const SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"];
@Origho-precious
Origho-precious / fibonacci.js
Last active October 1, 2022 23:42
Fibonacci sequence in javascript/node.js
const readline = require("readline").createInterface({
input: process.stdin,
output: process.stdout,
});
const fib = (num) => {
const fibs = [];
for (let i = 0; i < num; i++) {
if (i <= 1) {
[
{
"category": "Web Development",
"keywords": [
["Chief Technology Officer"],
["CTO"],
["R&D"],
["Architect"],
["Database", "Administrator"],
["Information", "Technology"],
@Origho-precious
Origho-precious / restdb.mdx
Last active October 19, 2021 16:00
RestDB Article Collection Models
Field Name Type Description Requirement Properties Format
title Text article title Required = true single line -
body Text article content Required = true multiline -
timestamp datetime Time the article was saved Required = true - MM DD hh:m
tags Text technologies used in the article Required = false single line -
@Origho-precious
Origho-precious / App.js
Created September 16, 2021 21:11
Anime Generator App.js - Routes
return (
<BrowserRouter>
<Switch>
<Route exact path="/" component={Homepage} />
<Route exact path="/anime/:name" component={Animepage} />
</Switch>
</BrowserRouter>
);
};
@Origho-precious
Origho-precious / App.js
Created September 16, 2021 21:10
Anime Generator App.js - 2
const App = () => {
const setTitles = useSetRecoilState(animeTitles);
const fetchAnimes = async () => {
try {
const res = await axios.get(
"https://animechan.vercel.app/api/available/anime"
);
setTitles(res?.data);
} catch (error) {
@Origho-precious
Origho-precious / App.js
Created September 16, 2021 21:08
Anime Generator App.js
import { useEffect } from "react";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import { useSetRecoilState } from "recoil";
import axios from "axios";
import { animeTitles } from "./store";
import Homepage from "./pages/home";
import Animepage from "./pages/anime";
@Origho-precious
Origho-precious / index.jsx
Created September 16, 2021 21:05
Anime Generator - Animepage
import { useState, useEffect } from "react";
import { Link, useParams } from "react-router-dom";
import axios from "axios";
import styled from "styled-components";
import SmallQuote from "../../components/SmallQuote/SmallQuote";
const Animepage = () => {
const param = useParams();
const [quotes, setQuotes] = useState([]);
const [loading, setLoading] = useState(false);
@Origho-precious
Origho-precious / index.jsx
Created September 16, 2021 21:03
Anime Generator Homepage
import { useRecoilValue } from "recoil";
import styled from "styled-components";
import AnimePill from "../../components/AnimePill/AnimePill";
import Pagination from "../../components/Pagination/Pagination";
import Quote from "../../components/Quote/Quote";
import { slicedAnimeTitles, animeTitles } from "../../store";
const Homepage = () => {
const animes = useRecoilValue(animeTitles);
const slicedAnimes = useRecoilValue(slicedAnimeTitles);
@Origho-precious
Origho-precious / Pagination.jsx
Created September 16, 2021 21:01
Pagination Component - 3
const StyledPagination = styled.div`
display: flex;
align-items: center;
border-width: 2px 2px 2px 0;
border-style: solid;
width: max-content;
& button {
outline: none;
background: transparent;
border: none;