This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dd iflag=direct if=/dev/sda of=/dev/null count=1 | |
sudo /usr/libexec/oci-growfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run as sudo: | |
sudo -i | |
Update server: | |
yum update -y | |
aapanel install command: | |
yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To use it, import useLocation from useLocation and then const [lat, errorMessage] = useLocation(); | |
import { useState, useEffect } from "react"; | |
export default () => { | |
const [lat, setLat] = useState(null); | |
const [errorMessage, setErrorMessage] = useState(""); | |
useEffect(() => { | |
window.navigator.geolocation.getCurrentPosition( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect } from "react"; | |
import axios from "axios"; | |
const useResources = (resource) => { | |
const [resources, setResources] = useState([]); | |
useEffect(() => { | |
(async (resource) => { | |
const response = await axios.get( | |
`https://jsonplaceholder.typicode.com/${resource}` | |
); | |
setResources(response.data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
function App() { | |
const [postList, setPostList] = useState([]); | |
const [currentPost, setCurrentPost] = useState(null); | |
const [isLoading, setIsLoading] = useState(false); | |
const [postClicked, setPostClicked] = useState(false); | |
const fetchPosts = () => { | |
fetch(`https://www.codeinwp.com/wp-json/wp/v2/posts?per_page=5`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1, h2, h3, h4, h5, h6 { | |
font-weight: 700; | |
font-family: 'Cairo', sans-serif; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1, h2, h3, h4, h5, h6 { | |
font-weight: 500; | |
font-family: 'Roboto', sans-serif; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'Roboto'; | |
font-style: normal; | |
font-weight: 300; | |
src: local(''), | |
url(../../uploads/fonts/Roboto-Light.woff) format('woff'); | |
} | |
@font-face { | |
font-family: 'Roboto'; | |
font-style: normal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'Cairo'; | |
font-style: normal; | |
font-weight: 400; | |
src: local(''), | |
url(../../uploads/fonts/Cairo-Regular.woff) format('woff'); | |
} | |
@font-face { | |
font-family: 'Cairo'; | |
font-style: normal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Display Custom Id | |
Description: This plugin assigns a random custom id to each registered user, you can show your custom id by inserting a short code into your posts. | |
Author: Mahamad Sayed | |
*/ | |
// generste random customer ID | |
function generate_custom_id (){ | |
$new_id = rand(1, 1000); | |
return $new_id; |
NewerOlder