Skip to content

Instantly share code, notes, and snippets.

View emailjohnthomascaballero's full-sized avatar
H̵͌̅́̆̎̄͑͘EL̴̚O̷ ̸̢̃͛̃͑̋̐̔̕W̸̗͆̀̂͋̍͘Ơ̵̞̼͋̃̏͌͝R̷̫̯̦̻͍̈̀͛̏̃́̏͜͝L̵̊͊͐̀̔̐̌͘D̵

JOHN THOMAS F. CABALLERO emailjohnthomascaballero

H̵͌̅́̆̎̄͑͘EL̴̚O̷ ̸̢̃͛̃͑̋̐̔̕W̸̗͆̀̂͋̍͘Ơ̵̞̼͋̃̏͌͝R̷̫̯̦̻͍̈̀͛̏̃́̏͜͝L̵̊͊͐̀̔̐̌͘D̵
View GitHub Profile
@emailjohnthomascaballero
emailjohnthomascaballero / mobile-responsive.css
Last active January 18, 2024 09:43
Responsive Design Cheat Sheet
/* SOURCE LINK: https://www.codeply.com/responsive-design-cheatsheet.html */
/* Bootstrap /*
/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */
/* Small devices (tablets, 768px and up) */
@emailjohnthomascaballero
emailjohnthomascaballero / form.php
Last active January 19, 2024 01:52
PHP FORM: Prevent Cross-site scripting (XSS)
<!-- SOURCE: https://www.w3schools.com/php/php_form_validation.asp -->
<!--
LOGIC:
htmlspecialchars() - prevent Cross-Site Scripting (XSS) attacks.
trim() - Strip unnecessary characters (extra space, tab, newline).
stripslashes() - Remove backslashes (\).
-->
<!-- SCRIPT -->
@emailjohnthomascaballero
emailjohnthomascaballero / nextjsbackbutton.tsx
Last active February 6, 2024 16:51
Next.js back button
{/* SOURCE LINK: https://stackoverflow.com/questions/51843119/next-js-react-go-back-to-the-previous-page */}
import { useRouter } from "next/navigation";
const Header = () => {
const router = useRouter();
return (
<div>
<button onClick={() => router.back()}>
BACK
@emailjohnthomascaballero
emailjohnthomascaballero / disableRightClickButton.tsx
Created February 20, 2024 15:14
use prevenDefault to prevent right-click event in your mouse to hide possible bugs
<Link
onClick={}
onContextMenu={(e) => e.preventDefault()}
>
<Image
src={`image.png`}
alt={}
width={80}
height={80}
className=""
// Remove Duplicate in Array:
[...new Set(arr)];
// Removes the first element from an array
arr.shift();
// Removes the last element fron an array
arr.pop();
// Adds value to the array