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 | |
class SessionManager{ | |
/* | |
SETTINGS FOR OUR SESSION | |
SESSION_NAME - Name of our session | |
ACTIVE_DAYS - Number of days you want the session to be active | |
*/ | |
public const SETTINGS=[ |
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
window.onload = () => { | |
let el = document.querySelector('[alt="www.000webhost.com"]').parentNode.parentNode; | |
el.parentNode.removeChild(el); | |
} |
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
function localStorageIsSupported() { | |
return (typeof(Storage) !== "undefined" && typeof(localStorage) !== "undefined"); | |
} | |
//console.log(localStorageIsSupported()); |
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 | |
// Example 1 | |
$arr=array( | |
"language"=>"en-US", | |
"theme"=>array( | |
"color"=>"blue", | |
"font-size"=>24 | |
) | |
); | |
$allowedColors=["blue","green","yellow"]; |
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 | |
class Database{ | |
protected $mysqli=null; | |
public function connect(){ | |
$this->mysqli = new mysqli("127.0.0.1","root","root","dbname",3306); | |
if ($this->mysqli->connect_error) { | |
return [FALSE,$this->mysqli->connect_error]; | |
} | |
else { | |
return [TRUE,"Connected"]; |
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
class node { | |
constructor(data) { | |
this.data = data; | |
this.next = null; | |
} | |
} | |
class SingleLinkedList { | |
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
getSize() { | |
console.log(this.length); | |
} |
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
delete(value) { | |
/* | |
if the list is empty | |
*/ | |
if (this.head == null) { | |
console.log("The list is empty"); | |
} | |
/* | |
Traverse through list recursively | |
*/ |
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
search(value) { | |
/* | |
if the list is empty | |
*/ | |
if (this.head == null) { | |
console.log("The list is empty"); | |
return false; | |
} | |
/* | |
Traverse through list recursively |
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
display() { | |
/* | |
if list is empty | |
*/ | |
if (this.head == null) { | |
console.log('List is empty'); | |
} | |
/* | |
Traverse through the list | |
recursively until `currentnode` |