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 | |
$x = 17; // whatever integer you want | |
$y = 52; // whatever integer you want | |
echo "x : $x\n"; | |
echo "y : $y\n"; | |
$x = $x + $y; | |
$y = $x - $y; |
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
# bismillah, shollallahu 'alaa Muhammad | |
# force update the mysql root credential | |
# | |
# mysql Ver 14.14 Distrib 5.7.30 | |
# on macos10.14 (x86_64) | |
# step 1 : find and kill the PID of the mysql process | |
ps aux | grep mysqld | |
kill -9 [PID] |
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
# bismillah - shollallahu 'alaa Muhammad | |
# | |
# assume you are working on your local working branch | |
# where the whole code is on your hand | |
# then you want to apply specific changes (commitId) into specific branch | |
# and then push that changes into remote repo afterward | |
# | |
# how to use : ./cherry.sh TARGET_BRANCH_NAME COMMIT_ID | |
# |
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 | |
// HACKERRANK-TEST-2 | |
// | |
// Question : https://imgur.com/QI2hoR0 | |
/* | |
* Complete the 'minDiff' function below. | |
* |
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 | |
// HACKERRANK-TEST-1 | |
// | |
// Question : https://imgur.com/aA7JaaA | |
/* | |
* Complete the 'areAlmostEquivalent' function below. | |
* |
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 that tells us whether or not an input string's openers and closers are properly nested. | |
// Examples: | |
// • "{ [ ] ( ) }" should return True | |
// • "{ [ ( ] ) }" should return False | |
// • "{ [ }" should return False | |
function parentheses_validatior($string){ | |
// remove spaces |
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 | |
// INTERFACE | |
ini_set('display_startup_errors', 1); | |
ini_set('display_errors', 1); | |
error_reporting(-1); | |
interface Vehicle{ | |
public function getCost($d); |
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 | |
// ABSTRACT | |
ini_set('display_startup_errors', 1); | |
ini_set('display_errors', 1); | |
error_reporting(-1); | |
abstract class Vehicle{ |
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 | |
// INTERFACE | |
ini_set('display_startup_errors', 1); | |
ini_set('display_errors', 1); | |
error_reporting(-1); | |
interface Notif{ | |
public function send($message, $contacts); |
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 | |
// POLYMORPHISM | |
ini_set('display_startup_errors', 1); | |
ini_set('display_errors', 1); | |
error_reporting(-1); | |
interface Shape{ | |
public function calcArea(); |
NewerOlder