Skip to content

Instantly share code, notes, and snippets.

View ahmedofali's full-sized avatar
🤓

Ahmed Ali ahmedofali

🤓
View GitHub Profile
@ahmedofali
ahmedofali / breadthFirstOnGraph.php
Created November 11, 2021 01:28
Example of breadth first algorithm on graph using queue
<?php
// Example of breadth first Algorithm
class Vertex
{
/**
* @var bool
*/
private bool $isExplored = false;
@ahmedofali
ahmedofali / DataMapperTest.php
Last active September 22, 2017 11:55
Data Mapper Design Pattern Complete Example
<?php
namespace DPatterns;
use \DPatterns\PostMemoryStorage;
use \DPatterns\Post;
use \DPatterns\PostMapper;
use \PHPUnit\Framework\TestCase;
class DataMapperTest extends TestCase
@ahmedofali
ahmedofali / custom_taxonomy_additional_fields.php
Created September 19, 2017 15:03
Wordpress Custom Taxonomy Additional Fields Used with any number of Taxonomies High Usability
<?php
/**
* Base class
**/
if ( ! class_exists( 'CustomTaxonomyAdditionalFields' ) ) {
abstract class CustomTaxonomyAdditionalFields {
protected $taxonomy_slug;
@ahmedofali
ahmedofali / PHP_Jargon.md
Last active July 21, 2017 19:00
php specific Important Modules and Jargon Should be know

PHP life Cycle

This is Explanation for the varoius questions about php.

What is php-mod?

mod_php means PHP, as an Apache module. Basically, when loading mod_php as an Apache module, it allows Apache to interpret PHP files (those are interpreted by mod_php).

There are (at least) two ways of running PHP, when working with Apache :

<?php
use Dashboard\CPS\wp_custom_post_status ;
/**
* Description of ArchivePostStatus
*
* @author ahmedali
*/
class oldPostStatus extends wp_custom_post_status {
@ahmedofali
ahmedofali / gist:b8018a29c6e366115b1358cb3f25f90c
Created January 1, 2017 10:45 — forked from Tabrisrp/gist:13348dbcd2bbb0d9406f
WordPress customizer custom tinymce control
class Text_Editor_Custom_Control extends WP_Customize_Control
{
public $type = 'textarea';
/**
** Render the content on the theme customizer page
*/
public function render_content() { ?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php