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 | |
const HEALTH_CHECK_INTERVAL_IN_SECONDS = '15'; | |
const HEALTH_CHECK_THROTTLE = '10 minutes'; | |
if (!isset($argv[1])) { | |
throw new InvalidArgumentException('Please provide one argument in JSON format'); | |
} | |
$data = json_decode($argv[1]); |
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
/** | |
* Parses current URL and uses the query parameters to | |
* replace them on an existing URL of a CTA in the document. | |
* | |
* For example, | |
* Current URL is: http://localhost:8000/?foobar=fromQuery# | |
* <a | |
* href="#" | |
* data-url="http://foobar.com/?foobar=foobarValue®ulator=regulatorValue" | |
* onclick="parseUrlAndInjectToCtaUrl(event)">Register here</a> |
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
#!/bin/bash | |
################################################################ | |
## | |
## MySQL Database Backup Script | |
## Written By: Rahul Kumar | |
## Updated by: Antonis Flangofas | |
## URL: https://tecadmin.net/bash-script-mysql-database-backup/ | |
## Last Update: Nov 28, 2019 | |
## |
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 delimiter // so SP can be created | |
DELIMITER // | |
CREATE PROCEDURE selectXamplifierUsers() | |
BEGIN | |
select id from users where is_system_user = 0 and email like "%xamplifier%"; | |
END | |
// | |
CREATE PROCEDURE deleteXamplifierUsers() | |
BEGIN |
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 | |
declare(strict_types=1); | |
function sayFizzBuzz(int $times = 0) | |
{ | |
$iterationPrint = ''; | |
for ($i = 0; $i <= $times; $i++) { | |
$iterationPrint = $i; |
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
//Reverse Binary | |
//Useful link: https://aticleworld.com/5-way-to-reverse-bits-of-an-integer/ | |
let decimal = process.argv[2] | |
if (typeof decimal === "undefined") { | |
throw new Error('Please provide a decimal number'); | |
} | |
console.log(reverseBits(new Number(decimal))) |
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 | |
/** | |
* Write a function that provides change directory (cd) function for an abstract file system. | |
* Notes: | |
* root path is '/'. | |
* path separator is '/'. | |
* parent directory is addressable as '..'. | |
* directory names consist only of English alphabet letters (A-Z and a-z). | |
* the function will not be passed any invalid paths. | |
* do not use built-in path-related functions. |
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 | |
/* | |
* Intreview question | |
* | |
* Build a function that returns common and longest sub-sequence of | |
* the two strings. | |
* | |
* For example, | |
* AAAA,AA outputs: AA |
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
// Add courses to the list (disallow adding same item twice) | |
// Remove courses from the list | |
// Limit courses by category | |
// Each course takes 5 credits, the list MUST have 6 courses | |
// Find desire course's category and suggest it on submit | |
// Course(or module) belongs to a Program | |
// Algebra belongs to math | |
// Linear belongs to math | |
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
{ | |
"name": "aflangofas/json", | |
"require": { | |
"fzaninotto/faker": "^1.6" | |
}, | |
"authors": [ | |
{ | |
"name": "Antonis Flangofas", | |
"email": "[email protected]" | |
} |
NewerOlder