Skip to content

Instantly share code, notes, and snippets.

View olawanlejoel's full-sized avatar
🇳🇬
Exploring...

Joel Olawanle olawanlejoel

🇳🇬
Exploring...
View GitHub Profile
@olawanlejoel
olawanlejoel / setup.dockerfile
Last active September 6, 2022 15:34
docker-compose
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:0.15.3
@olawanlejoel
olawanlejoel / App.js
Created July 13, 2022 21:25
How To Perform GET HTTP Request in React’s Functional Component With Fetch API
import { useState, useEffect } from "react";
const App = () => {
const [posts, setPosts] = useState([]);
useEffect(() => {
fetch("https://jsonplaceholder.typicode.com/posts")
.then((res) => res.json())
.then((data) => {
console.log(data);
@olawanlejoel
olawanlejoel / App.js
Created July 13, 2022 21:22
How To Perform GET HTTP Request in React’s Functional Component With Axios
import { useState, useEffect } from "react";
// import axios library - make sure you install it using - npm i axios
import axios from "axios";
const App = () => {
const [posts, setPosts] = useState([]);
useEffect(() => {
axios
@olawanlejoel
olawanlejoel / App.js
Last active July 13, 2022 21:18
How To Perform GET HTTP Request in React’s Class Component With Fetch API
import React, { Component } from "react";
class App extends Component {
constructor(props) {
super(props);
this.state = {
posts: []
};
}
@olawanlejoel
olawanlejoel / App.js
Last active July 13, 2022 21:19
How To Perform GET HTTP Request in React’s Class Component With Axios
import React, { Component } from "react";
// import axios library - make sure you install it using - npm i axios
import axios from "axios";
class App extends Component {
constructor(props) {
super(props);
this.state = {
@olawanlejoel
olawanlejoel / App.js
Created July 1, 2022 18:44
How to perform Pagination with GraphCMS and React from Scratch using GraphQL to query data.
import React, { useState, useEffect } from 'react';
import { request } from 'graphql-request';
import Paginate from './Paginate';
const App = () => {
const [blogPosts, setBlogPosts] = useState([]);
const [currentPage, setCurrentPage] = useState(1);
const [totalPosts, setTotalPosts] = useState();
const [postsPerPage] = useState(3);
<?php
if (isset($_POST['generate'])) {
$name = strtoupper($_POST['name']);
//designed certificate picture
$image = "certi.png";
$createimage = imagecreatefrompng($image);
@olawanlejoel
olawanlejoel / index
Last active February 14, 2020 12:35
<form method="post" action="">
<div class="form-group col-sm-6">
<input type="text" name="name" class="form-control" id="name" placeholder="Enter Name Here...">
</div>
<button type="submit" name="generate" class="btn btn-primary">Generate</button>
</form>
imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text )
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form action="action.php" method="POST">
<p>A simple Calculator built with php oop</p>
<label>First Number</label><br>