Skip to content

Instantly share code, notes, and snippets.

💭
I love coding

Oyetoke Toby CITGuru

💭
I love coding
Block or report user

Report or block CITGuru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View goldensuper.html
<html lang="en" class="js-focus-visible"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>GoldenSuperNG - Homepage</title>
<link href="assets/style.css" rel="stylesheet">
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
</head>
<body data-gr-c-s-loaded="true">
<header class="text-center p-2" style="font-size: 60px">
@CITGuru
CITGuru / User.js
Last active Jan 26, 2020
User Schema Model : Plain
View User.js
const mongoose = require("mongoose");
const validator = require("validator");
const bcrypt = require("bcrypt");
const uuid = require("uuid");
const { Schema } = mongoose;
const UserSchema = new Schema({
first_name: {
type: String,
required: false
@CITGuru
CITGuru / app.js
Created Jan 26, 2020
App.js - Live DB
View app.js
const express = require("express");
const cors = require("cors");
require("dotenv").config();
const app = express();
const { LiveDB } = require("./db");
// Middleware
app.use(express.json());
app.use(cors());
@CITGuru
CITGuru / ReactComponentExercise.js
Last active Dec 8, 2019
ReactComponentExercise.js.txt (Original)
View ReactComponentExercise.js
/**
* This React class is intended to query an endpoint that will return an alphanumeric string, after clicking a button.
* This component is passed a prop "apiQueryDelay", which delays the endpoint request by N milliseconds. There is a
* second button to disable this functionality and have the endpoint request run immediately after button click.
* This data is then to be displayed inside a simple container.
* The "queryAPI" XHR handler will return the endpoint response in the form of a Promise (such as axios, fetch).
* The response object will look like the following: {data: "A0B3HCJ"}
* The containing element ref isn't used, but should remain within the class.
* Please identify, correct and comment on any errors or bad practices you see in the React component class below.
* Additionally, please feel free to change the code style as you see fit.
@CITGuru
CITGuru / Article.js
Last active Dec 3, 2019
Article Component 3
View Article.js
import React, { useState, useEffect } from "react";
import axios from "axios";
import useInfiniteScroll from "./useInfinite"
const Article = () => {
const [data, setData] = useState([]);
const [page, setPage] = useState(1);
const [isFetching, setIsFetching] = useInfiniteScroll(moreData);
const loadData = () =>{
@CITGuru
CITGuru / useInfinite.js
Created Dec 3, 2019
use infinite scroll
View useInfinite.js
import { useState, useEffect } from "react";
const useInfiniteScroll = callback => {
const [isFetching, setIsFetching] = useState(false);
useEffect(() => {
window.addEventListener("scroll", isScrolling);
return () => window.removeEventListener("scroll", isScrolling);
}, []);
@CITGuru
CITGuru / Article.js
Last active Dec 3, 2019
Article Component 2
View Article.js
import React, { useState, useEffect } from "react";
import axios from "axios";
const Article = () => {
const [data, setData] = useState([]);
const [page, setPage] = useState(1);
const [isFetching, setIsFetching] = useState(false);
const loadData = () =>{
@CITGuru
CITGuru / Article.js
Last active Dec 3, 2019
React Component - Article (useInfiniteScroll)
View Article.js
import React, { useState, useEffect } from "react";
import axios from "axios";
const Article = () => {
const url = "https://medrum.herokuapp.com/articles";
const [data, setData] = useState([]);
useEffect(() => {
axios.get(url).then(res => {
setData(res.data);
});
@CITGuru
CITGuru / Article.js
Last active Dec 3, 2019
React Component - Article (useInfiniteScroll)
View Article.js
import React, { useState, useEffect } from "react";
import axios from "axios";
const Article = () => {
const url = "https://medrum.herokuapp.com/articles";
const [data, setData] = useState([]);
useEffect(() => {
axios.get(url).then(res => {
setData(res.data);
});
@CITGuru
CITGuru / get_all_links.py
Created Nov 17, 2019
Get all links from a website
View get_all_links.py
You can’t perform that action at this time.