- Fork project project berikut sebagai base pengerjaan test https://github.com/neos1803/mock-technical-test.git
- Commit perubahan yang telah dikerjakan, bisa menggunakan cli:
git commit -am 'Add some feature'
atau menggunakan gui - Push ke fork yang telah dibuat:
git push origin nama-pribadi
- Silahkan open pull request.
- Penilaian akan dilakukan pada pull request masing-masing
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
CREATE OR REPLACE FUNCTION public.after_update() | |
RETURNS trigger | |
LANGUAGE plpgsql | |
AS $function$ | |
declare | |
maximum character(5); | |
nextMax character(5); | |
BEGIN | |
-- Find max urutan | |
select max(tnp.urutan) into maximum from something; |
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
find . -name '*.orig' -delete |
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 { sign } = require('jsonwebtoken') | |
const token = new Promise((resolve, reject) => { | |
sign({ data: "Your Data" }, "Your_Secret", {}, (err, token) => { | |
if (err) reject(err); | |
else resolve(token) | |
}); | |
}); |
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 { stat, mkdir } = require('fs/promises'); | |
/** Start of creating directory */ | |
const directory = `your path like directory`; | |
await stat(directory) | |
.then(() => { | |
console.log(`Directory: ${dir} exist`); | |
return true | |
}) | |
.catch(async (error) => { |
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 { existsSync, mkdir } = require('fs'); | |
/** Start of creating directory */ | |
const directory = `your path like directory`; | |
if (!existsSync(directory)) { | |
mkdir(directory, { recursive:true }, (err) => { | |
if (err) { | |
return console.error(err); | |
} | |
}) |
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 duplicate = arr1.filter((v) => arr2.includes(v)).length > 0 |
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
/** | |
* Input: ['First Message', 'Second Message'] | |
* Output: `1. First message \n 2. Second Message \n` | |
*/ | |
export function arrayToTextWithEnter(arr: Array<any>): String { | |
let response = `` | |
arr.forEach((v, i) => { | |
response = response + `${i + 1}. ${v} \n` | |
}); |
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 example = Array.from({ length: 1000 }, (_, i) => String(i + 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
const array = [1,2,3,4,5,6,7,8]; | |
// Declarative looping example | |
array.forEach((x) => someFunction()); | |
array.map((x) => someFunction()); | |
array.reduce((x) => someFunction()); | |
// Imperative looping | |
for (const a of array) { | |
someFunction(); | |
} |
NewerOlder