Skip to content

Instantly share code, notes, and snippets.

View mhmohon's full-sized avatar
🎯
Focusing

Mosharrf Hossain mhmohon

🎯
Focusing
  • Apartments & Developments
  • Melbourne, Australia (Remote)
  • 20:21 (UTC +06:00)
  • LinkedIn in/mhmohon
View GitHub Profile
@mhmohon
mhmohon / animal.php
Last active March 22, 2019 13:15
PHP inheritence
<?php
//Encapsulation with Inheritance
class Animal
{
private $family;
private $food;
public function __construct($family, $food)
{
$this->family = $family;
$this->food = $food;
<?php
class stack {
protected $stack;
protected $limit;
public function __construct($limit = 10, $initial = array()) {
$this->stack = $initial; // initialize the stack
$this->limit = $limit; // stack can only contain this many items
<?php
do_action( 'before_my_loop' ); //create the hooks
add_action( 'before_my_loop', 'add_comment_before_loop', 10 );
function add_comment_before_loop()
{
echo "<b>Welcome to my blog</b>";
}
?>
<?php
function awesome_script_enqueue()
{
wp_enqueue_style('customstyle', get_template_directory_uri(). '/css/awesome.css', array(), '1.0.0', 'all');
wp_enqueue_script('custom.js', get_template_directory_uri() . '/js/awesome.js', array(), '1.0.0', true);
wp_enqueue_style('custom-css', get_stylesheet_directory_uri(). '/assets/css/custom.css', ['custom-css'], time(), 'all');
}
@mhmohon
mhmohon / MySQLDriver.php
Created March 22, 2019 13:45
Using Abstract class and interface
<?php
abstract class DBCommonMethods //creating abstract class
{
private $host;
private $db;
private $uid;
private $password;
public function __construct($host, $db, $uid, $password)
{
$this->host = $host;
@mhmohon
mhmohon / mysqldrive.php
Created April 14, 2019 23:39
Database Handler
<?php
class MySqlDrive
{
private $host = 'localhost';
private $user = 'root';
private $password = '';
private $db = 'codeigniter_crud';
private $db_handle;
<html>
<head>
</head>
<body>
<?php
require('process.php');
$db_con = new MySqlDrive();
$query = "SELECT * FROM student";
<?php
require ('core/MySqlDrive.php');
$db_con = new MySqlDrive();
session_start();
$name = "";
$phone = "";
$roll = "";
$id = "";
$update = FALSE;
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Mail;