Skip to content

Instantly share code, notes, and snippets.

View ImtiazEpu's full-sized avatar
🇵🇸
I stand with Palestine 🇵🇸

Imtiaz Ahmed ImtiazEpu

🇵🇸
I stand with Palestine 🇵🇸
View GitHub Profile
@ImtiazEpu
ImtiazEpu / gist:89f02ffdcc163ad574e88070e838262c
Created October 30, 2020 19:11 — forked from manchumahara/gist:0e1710721ab5741b68f3e8aad84fd8fd
Single Click "Visit Site" Menu in WordPress Admin Bar(Admin Top Menu) https://manchumahara.com/?p=1266&preview=true
add_action( 'admin_bar_menu', 'admin_bar_menu_visitsite', 999 );
function admin_bar_menu_visitsite( $wp_admin_bar ) {
if ( current_user_can( 'manage_options' ) ) {
$wp_admin_bar->add_node(
array(
'id' => 'visitsite',
'title' => 'Visit Site',
'href' => site_url(),
'meta' => array( 'class' => 'visitsite_adminbar', 'target' => '_blank' ),
<section>
<div id="why-chose" class="home-sections">
<div class="cbxinner-contact">
<div class="container">
<div class="row">
<div class="col-md-4 col-12 why-chose-block-wrap">
<div class="block">
<img class="block-icon" src="https://codeboxr.com/wp-content/themes/themeboxr/images/why-choose/map-icon.png" alt="100% GPL Code" />
<h3>Address</h3>
<?php
$link = get_the_permalink();
$title = get_the_title();
$text_encoded =urlencode($title);
$fb_link = add_query_arg('u', urlencode($link), 'https://www.facebook.com/sharer/sharer.php');
$tw_link = add_query_arg('status', $title.' '.urlencode($link), 'https://twitter.com/home');
$ln_link = add_query_arg(array(
'url' => urlencode($link),
'title' => urlencode($title),
<?php
$tuition_fee = 25000;
$commission = (20000 < $tuition_fee) ? 'Your commission is twenty-five percent' :((10000 < $tuition_fee && 20000 >= $tuition_fee)?'Your commission is twenty percent':((7000 < $tuition_fee && 10000 >= $tuition_fee)?'Your commission is fifteen percent':'invalid'));
echo $commission;
<?php
//Q: Write a Reusable PHP Function that can check Even & Odd Number And Return Decision
function check_even_odd_number($number): string {
if ($number % 2 == 0) {
return "The number is even.";
} else {
return "The number is odd.";
}
@ImtiazEpu
ImtiazEpu / setup_guied.md
Last active February 14, 2023 19:43
How to setup sendgrid email in Laravel

Setup sendgrid email in Laravel

Here are the steps to set up SendGrid email in Laravel:

  1. Sign up for a SendGrid account and obtain an API key.

  2. Add the SendGrid API key to your Laravel environment file (.env) by adding the following line:

SENDGRID_API_KEY=YOUR_SENDGRID_API_KEY
<?php
//Q 1: Write a PHP function to sort an array of strings by their length, in ascending order. (Hint: You can use the usort() function to define a custom sorting function.)
function sort_arr_by_length($arr) {
usort($arr, function($a, $b) {
return strlen($a) - strlen($b);
});
return $arr;
}
{
"order_title": "U-41344",
"order_desc": "",
"billing": {
"first_name": "Adam",
"last_name": "Alig",
"company": "Riverside Cabinets",
"email": "[email protected]",
"phone": "615 218 5072",
"address_1": "6451 E Buckeye Bottom Rd",
{
"title": "#58377",
"order_id": 58377,
"data": {
"line_items": {
"line_items": [
{
"product_id": 20782,
"product_img_url": "https:\/\/cdn.hoodsly.com\/wp-content\/uploads\/2020\/10\/07000809\/Curved-With-Strapping-300x300.jpg",
"product_name": "Quick Shipping Options",
-- Use the employees table to answer the following questions:
a. SELECT * FROM employees;
-- This command selects all columns and rows from the employees table.
b. SELECT name, salary FROM employees WHERE salary > 50000;
-- This command selects the name and salary columns of all employees with a salary greater than 50000.
c. SELECT AVG(salary) FROM employees;
-- This command calculates the average salary of all employees.