3nf

php

Generate MySQL-Formatted Dates

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

javascript

JavaScript Class with Constructor and Method

This JavaScript code defines a Person class with a constructor for initializing properties (name...

nodejs graphql

GraphQL API Server with Node.js and Apollo Server

This snippet demonstrates how to build a basic GraphQL API server using Node.js with Apollo...

python

Reshape NumPy Array

Learn how to reshape a one-dimensional array into a matrix using NumPy in Python. This example...

javascript

Read and Write Files in Node.js using 'fs' module

This Node.js code demonstrates reading content from a file ('file.txt') and writing to a new...

bash

How to Paste in an SSH Terminal Without a Mouse

Learn keyboard shortcuts to paste into an SSH terminal without using a mouse on Linux, macOS,...

javascript python

Reversing a String in JavaScript: A Simple Guide

This JavaScript code defines a function reverseString that takes a string (str) as input and...

python

List Files in a Directory Using os Module

This Python script lists all files and directories in a specified path with proper error...

php

JWT Token Creation and Verification in Node.js using 'jsonwebtoken'

This Node.js code uses the 'jsonwebtoken' module to create a JWT token with a payload and set...