Post

php

Generate MySQL-Formatted Dates

Use `date()` in PHP to format timestamps. For example, `date('Y-m-d')` gives the current date,...

javascript

JavaScript Prime Number Check

This JavaScript code defines a function (isPrime) to check whether a given number is prime. It...

javascript

Asynchronous Data Fetching in JavaScript using 'fetch'

This JavaScript code defines an asynchronous function (fetchData) that uses the Fetch API with...

bash

Create Resource Controller in Laravel

This Laravel Artisan command generates a resource controller named 'MyResourceController' with...

javascript

Simple Calculator

This JavaScript code defines a function calculate that performs basic arithmetic operations...

bash

How to view free space on a Linux server

This command provides a quick overview of your server's disk usage, helping you manage resources...

javascript

Detect Dark Mode Preference

This JavaScript code checks whether the user prefers dark mode by using the window.matchMedia...

javascript

Access Command-line Arguments

This Node.js code accesses and logs the command-line arguments passed to the script, excluding...