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
/** | |
* Returns an array of strings, with different positions of char in the string - str | |
*/ | |
function swapAll(str, char) { | |
const result = []; | |
for (let i = 0; i <= str.length; i += 1) { | |
const newStr = `${str.slice(0, i)}${char}${str.slice(i, str.length)}`; | |
result.push(newStr); | |
} | |
return result; |
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
/* eslint-disable no-param-reassign */ | |
/* eslint-disable no-await-in-loop */ | |
/** | |
* | |
* @param {string} stateId | |
* @returns {object} | |
*/ | |
const getLgas = async (stateId) => { | |
const formData = new FormData(); |
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
const testRuntimeWithConsole = () => { | |
console.time('====== WITH CONSOLE.LOG ====='); // the start time | |
let result = 0; | |
for (let i = 0; i < 100; i += 1) { | |
result += i; | |
console.log(result); // log the result to the console | |
} | |
console.timeEnd('====== WITH CONSOLE.LOG ====='); // the end time | |
return result; | |
}; |
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 time | |
def test_runtime_with_print(): | |
start_time = time.time() | |
result = 0 | |
for i in range(100): | |
result = result + i | |
print(result) | |
print("======= WITH PRINT =======: {} milliseconds".format((time.time() - start_time) * 1000)) | |
return result |
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
[ | |
"Agency and Consultancy", | |
"Agriculture", | |
"Aluminium and Metal", | |
"Artisans", | |
"Arts and Entertainment", | |
"Automobile", | |
"Baking Services", | |
"Beauty and Salon", | |
"Books and Stationery", |
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
const categories = [ | |
"Abattoir and meat selling services", | |
"Accommodation", | |
"Accounting / auditing consultancy ", | |
"Accounting / auditing, taxation and financial management consultancy ", | |
"Accounting and auditing consultancy", | |
"Accounting and general goods delivery and merchandise movers", | |
"Activities auxiliary to financial services and insurance activities", | |
"Activities of extraterritorial organizations and bodies", | |
"Activities of head officies;management consultancy activities", |
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
// This data is scraped from https://cdn.materialdesignicons.com/5.3.45/ | |
const mdiIcons = [ | |
{ | |
"unicode": "F01C9", | |
"name": "mdi-ab-testing" | |
}, | |
{ | |
"unicode": "F1328", | |
"name": "mdi-abjad-arabic" |
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
// This data is scraped from https://cdn.materialdesignicons.com/5.3.45/ | |
const mdiIcons = [ | |
{ | |
"unicode": "F01C9", | |
"name": "mdi-ab-testing" | |
}, | |
{ | |
"unicode": "F1328", | |
"name": "mdi-abjad-arabic" |
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
[ | |
"fa-adjust", | |
"fa-adn", | |
"fa-align-center", | |
"fa-align-justify", | |
"fa-align-left", | |
"fa-align-right", | |
"fa-ambulance", | |
"fa-anchor", | |
"fa-android", |
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
-- Selects season name, group id and client id | |
WITH RECURSIVE getSeason(SeasonName, GroupID, SeasonID, ClientID) AS ( | |
SELECT | |
DISTINCT Seasons.SeasonName, | |
SeasonClients.GroupID, | |
SeasonClients.SeasonID, | |
SeasonClients.ClientID | |
FROM SeasonClients | |
INNER JOIN Seasons ON SeasonClients.SeasonID = Seasons.SeasonID | |
WHERE |
NewerOlder