Skip to content

Instantly share code, notes, and snippets.

View harmlessprince's full-sized avatar
🏠
Working from home

Adewuyi Taofeeq Olamilekan harmlessprince

🏠
Working from home
View GitHub Profile
<?php
return [
[
'code' => 'BAG',
'desc' => 'Bag',
],
[
'code' => 'CTN',
'desc' => 'Carton'
],
@harmlessprince
harmlessprince / dateFormats.php
Created May 10, 2021 20:55
An array of 13 date formats
<?php
return [
[
"id" => 1,
"date_order" => 'MM/DD/YY',
'Description' => 'Month-Day-Year with leading zeros (02/17/2009)'
],
[
"id" => 2,
"date_order" => 'DD/MM/YY',
@harmlessprince
harmlessprince / SortAndMergeArrayOfStudentAges.php
Last active May 12, 2021 15:23
This function takes in two set of arrays, merges them and sort them using the quick sort algorithm. It returns a new array of the merged arrays in ascending order. It has a worst case time complexity of O(nlog(n)) and space complexity of 0(log(n))
<?php
function SortAndMergeArrayOfStudentAges($firstArray, $secondArray)
{
if (gettype($firstArray) != 'array' && gettype($secondArray) != 'array') {
return [];
}
if (gettype($firstArray) == 'array' && gettype($secondArray) != 'array') {
return quickSort($firstArray);
}
@harmlessprince
harmlessprince / CalculateProducts.php
Created May 2, 2021 09:43
Product of all other numbers an array
<?php
function CalculateProducts($array)
{
//check if array is undefined
if (!$array) {
return [];
}
//check if array has length equal to zero
if (count($array) == 0) {
@harmlessprince
harmlessprince / FindStartEndOfVal.php
Last active April 27, 2021 03:53
This function returns start and end position of of given value in an array
<?php
function FindStartEnd($array, $val)
{
$type = gettype($array);
try {
if (!$array) {
throw new Exception("Expects parameter 1 to be array and should contain at least one value");
}
if (!is_numeric($val)) {
please am final year studen.. been given the tille above as a project topic.. the application is expected to keep track of complete mobile log which includes SMS,images,call,browsing history.
i want to buuild this app using react. i was a able to get a package that keeps track of call history.. bit have not been able to see for of SMS,images,browsing histories..i need suggestions