((0|44|\+44|\+44\s*\(0\)|\+44\s*0)\s*)?7(\s*[0-9]){9}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implementation of Queue using PHP | |
* @author Al- Imran Ahmed | |
*/ | |
class Element{ | |
public $value; | |
public $next; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//----------------------------------------How to use?---------------------------------------------- | |
// 1. Add the following private method in App\Providers\AppServiceProvider class | |
// 2. Call this function from boot() method of same class: $this->extendCollectionWithPaginate(); | |
//------------------------------------------------------------------------------------------------- | |
/** | |
* Macro to extends Laravel Collection | |
* If you have a collection called $item and you want to paginate it like Eloquent paginate: | |
* $items->paginate($perPage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
- Or, request confirmation in the process - | |
<a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
*/ | |
(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import html | |
from tkinter import * | |
import xml.dom.minidom as dom | |
# author Al Imran Ahmed | |
# A very simple interface to decoded xml. i.e. <tag> => <tag> | |
# requires python3^ with tkinter GUI library installed | |
class Application(Frame): | |
def decode_xml(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Change the leader key from \\ to comma | |
let mapleader = ',' | |
"Show line number of row | |
set number | |
"Write automatically when close the buffer | |
set autowriteall | |
"Limit the Text window with 80 character |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Al- Imran Ahmed | |
* Sorting an array using insertion sort algorithm | |
* @param int a[] is an array to be sorted | |
* @param int size is the size of the array | |
*/ | |
void insertionSort(int a[], int size){ | |
for(int i = 1; i < size; i++){ | |
for(int j = i; j >= 0; j--){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implementation of Stack using PHP | |
* @author Al- Imran Ahmed | |
*/ | |
class Node{ | |
public $value; | |
public $next; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problem Statement | |
----------------------------- | |
Find an Array: | |
Implement a method that given two arrays as parameters will find the starting index where the second parameter occurs as a sub-array in the array given as the first parameter. | |
Your implementations should return -1 if the sub-array cannot be found. | |
Your implementation must implement the FindArray interface given bellow: |
NewerOlder