Skip to content

Instantly share code, notes, and snippets.

View ImtiazEpu's full-sized avatar
🔐
I'm sudo root

Imtiaz Ahmed ImtiazEpu

🔐
I'm sudo root
View GitHub Profile
<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>
@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' ),
@ImtiazEpu
ImtiazEpu / human_readable_time.php
Last active June 7, 2020 15:38
human readable time fuction
/**
* Time to human readable time
*
* @param $ts
* @param string $fallback_format
*
* @return false|string
*/
public function time2str( $ts, $fallback_format = 'M j, Y H:i' ) {
if ( ! ctype_digit( $ts ) ) {
@ImtiazEpu
ImtiazEpu / .gitignore
Created November 6, 2019 07:41
.gitignore file for WordPress & PhpStorm
# Created by https://www.gitignore.io/api/phpstorm,wordpress
# Edit at https://www.gitignore.io/?templates=phpstorm,wordpress
### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
@ImtiazEpu
ImtiazEpu / .gitignore
Created November 6, 2019 07:37
gitignore file for laravel, vue, phpstorm & vs code
# Created by https://www.gitignore.io/api/vue,laravel,phpstorm,visualstudiocode
# Edit at https://www.gitignore.io/?templates=vue,laravel,phpstorm,visualstudiocode
### Laravel ###
/vendor/
node_modules/
npm-debug.log
yarn-error.log
@ImtiazEpu
ImtiazEpu / repeatable-fields-metabox.php
Created October 14, 2019 11:29 — forked from helen/repeatable-fields-metabox.php
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@ImtiazEpu
ImtiazEpu / add-wordpress-settings-page.php
Created September 24, 2019 06:47 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
public function processOrder()
{
$validator = Validator::make(request()->all(),[
'customer_name' => 'required',
'customer_phone_number' => 'required',
'address' => 'required',
'city' => 'required',
'postal_code' => 'required',
]);
if ($validator->fails()){
@ImtiazEpu
ImtiazEpu / Old Codestar framework documentation.md
Last active August 18, 2022 09:41
Old Codestar framework documentation

Codestar Framework

A Lightweight and easy-to-use WordPress Options Framework. It is a free framework for building theme options. Save your time!

Screenshot

Codestar Framework Screenshot

Read the documentation for details documentation

Installation

@ImtiazEpu
ImtiazEpu / test.php
Created July 15, 2019 19:22
Problem solving
<?php
//Basis Knowledge Test:
//==========================
//1. Write a PHP function that to remove all zeroes from a string and return 3 different output.
//Input String : '000892021.2408000'
//Expected below outputs
//Output 1: '892021.2408' (all zeros remove from start and end)
//Output 2: '892021.2408000' (remove only start zero)
//Output 3: '000892021.2408' (remove only end zero)