Skip to content

Instantly share code, notes, and snippets.

View Shakil-Shahadat's full-sized avatar
🏠
Working from home

Shakil Shahadat Shakil-Shahadat

🏠
Working from home
View GitHub Profile
@Shakil-Shahadat
Shakil-Shahadat / query.js
Last active July 1, 2024 04:41
[ Delete ] Functions to shorten querySelector* calls in JavaScript
function qs( cls )
{
return document.querySelector( cls );
}
function qsa( cls )
{
return document.querySelectorAll( cls );
}
@Shakil-Shahadat
Shakil-Shahadat / favicon.html
Last active July 3, 2024 04:46
✓ Favicon HTML Code
<link rel="icon" href="src/favicon.ico">
<link rel="icon" href="src/favicon.svg" type="image/svg+xml">
@Shakil-Shahadat
Shakil-Shahadat / post.php
Last active March 24, 2025 13:58
✓ POST Request by Fetch
<?php
header( 'Access-Control-Allow-Origin: *' );
$received = file_get_contents( 'php://input' );
echo $received;
// Ref: https://www.php.net/manual/en/reserved.variables.post.php#125651
@Shakil-Shahadat
Shakil-Shahadat / get.php
Last active March 23, 2025 11:40
✓ GET Request by Fetch
<?php
header( 'Access-Control-Allow-Origin: *' );
$received = file_get_contents( 'php://input' );
echo $received;
// Ref: https://www.php.net/manual/en/reserved.variables.post.php#125651
@Shakil-Shahadat
Shakil-Shahadat / style.css
Last active June 23, 2024 22:58
✓ CSS Required to Pass WordPress Theme Check Plugin ( Copied from Underscore Theme )
.wp-caption
{
margin-bottom: 1.5em;
max-width: 100%;
}
.wp-caption-text
{
text-align: center;
}
.sticky
@Shakil-Shahadat
Shakil-Shahadat / element.js
Last active July 1, 2024 04:42
[ Delete ] Create an Element in JavaScript
// Create an Element
let ele = document.createElement( 'div' ); // Replace 'div' with required element
// Insert Text
ele.innerText = 'Hello World!';
// or
ele.innerHTML = 'Hello World!';
// or, not recommended
let textNode = document.createTextNode( 'Hello World!' ); // Create a text node
ele.appendChild( textNode );
@Shakil-Shahadat
Shakil-Shahadat / wavPlayer.ino
Last active June 23, 2024 23:00
✓ Play .wav files in Arduino
#include "SD.h"
#include "SPI.h"
#include "TMRpcm.h"
#define SD_ChipSelectPin 10
TMRpcm tmrpcm;
void setup()
{
@Shakil-Shahadat
Shakil-Shahadat / localStorage.js
Last active June 22, 2024 15:36
[ Delete ] localStorage Store & Retrieve Test
// Store
localStorage.setItem( 'name', 'Smith' );
// Retrieve
console.log( localStorage.getItem( 'name' ) );
@Shakil-Shahadat
Shakil-Shahadat / storageCheck.js
Last active June 22, 2024 15:36
[ Delete ] Check for localStorage/sessionStorage
if ( typeof( Storage ) !== 'undefined' )
{
console.log( 'Storage Exists!' );
}
else
{
console.log( 'Storage doesn\'t Exists!' );
}
@Shakil-Shahadat
Shakil-Shahadat / mail.php
Last active June 23, 2024 23:03
[ Delete ] Send Email Using PHP
<?php
$to = '[email protected]';
$subject = 'Test mail';
$message = 'Hello! This is a simple email message.';
$from = '[email protected]';
$headers = 'From: ' . $from;
mail( $to, $subject, $message, $headers );
echo 'Mail Sent.';