Skip to content

Instantly share code, notes, and snippets.

View shameemreza's full-sized avatar
🦜
Talk is cheap. Check My Code, Blog and Portfolio.

Shameem Reza shameemreza

🦜
Talk is cheap. Check My Code, Blog and Portfolio.
View GitHub Profile
function UserProfile({ user }) {
return (
<div>
<h1>{user.name}</h1>
<p>{user.bio}</p>
</div>
);
}
export async function getServerSideProps(context) {
@shameemreza
shameemreza / ssrpost3.js
Last active January 27, 2023 05:11
Example of Mastering the Art of Server-Side Rendering with Next.js
import axios from 'axios'
const About = ({ data }) => {
return (
<div>
<h1>About Our App</h1>
<p>Our app is the best thing since sliced bread.</p>
<p>Data from API: {data}</p>
</div>
)
@shameemreza
shameemreza / ssrpost2.js
Created January 27, 2023 05:06
Example of Mastering the Art of Server-Side Rendering with Next.js
import Link from 'next/link'
const Home = () => {
return (
<div>
<Link href="/about">
<a>About</a>
</Link>
</div>
)
@shameemreza
shameemreza / ssrpost1.js
Created January 27, 2023 05:05
Example for Mastering the Art of Server-Side Rendering with Next.js
import React from 'react'
const About = () => {
return (
<div>
<h1>About Our App</h1>
<p>Our app is the best thing since sliced bread.</p>
</div>
)
}
@shameemreza
shameemreza / equality.js
Created January 20, 2023 12:05
Strict and Loose Equality Example in JavaScript
// Use strict equality when comparing variables of the same type
let age = 25;
let legalAge = 21;
console.log(age === legalAge); // false
// Use loose equality when comparing variables that may be a string or a number
let input = "25";
let number = 25;
console.log(input == number); // true
@shameemreza
shameemreza / disallowed-comment-keys.txt
Created January 16, 2023 03:13
Use these keys as Disallowed Comment Keys to your WordPress site's Discussion settings.
Amoxicillin
insurance companies
cashless society
Viagra
Zithromax
.net
.org
.com
mewkid.net
mewkid
@shameemreza
shameemreza / .htaccess
Created January 14, 2023 16:31
Force HTTPS in WordPress
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
/**
* Disable all the Nags & Notifications
* https://orixlab.net/disable-updates-for-specific-plugin-in-wordpress
* Place at bottom in theme functions.php
*/
function remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','remove_core_updates');
/**
* Disable Plugin Update Notifications
* https://orixlab.net/disable-updates-for-specific-plugin-in-wordpress
* Place at bottom in theme functions.php
*/
remove_action('load-update-core.php','wp_update_plugins');
add_filter('pre_site_transient_update_plugins','__return_null');
/**
* Disable WordPress Update nag
* https://orixlab.net/disable-updates-for-specific-plugin-in-wordpress
* Place at bottom in theme functions.php
*/
add_action('after_setup_theme','remove_core_updates');
function remove_core_updates()
{
if(! current_user_can('update_core')){return;}