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 generateUniqueID(length) { | |
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; | |
let uniqueID = ''; | |
while (uniqueID.length < length) { | |
const randomIndex = Math.floor(Math.random() * characters.length); | |
const randomChar = characters.charAt(randomIndex); | |
// Make sure the generated character is not already in the uniqueID | |
if (!uniqueID.includes(randomChar)) { |
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 JavaScript function checks if a Git commit message follows a specific format and provides | |
* success or failure messages accordingly. | |
* @param buffer - The `buffer` parameter is a buffer object that contains the content of a file. In | |
* this code, it is used to read the content of the `.git/COMMIT_EDITMSG` file. | |
* @returns The code is returning the first line of the commit message from the `.git/COMMIT_EDITMSG` | |
* file. | |
*/ | |
let supportsColor = { stdout: true }; | |
const fs = require("fs"); |
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 _ = require("lodash"); | |
const myClassmates = ["John", "Jane"]; | |
const mySenior = ["Alice", "Bob"]; | |
console.time("Native concat"); | |
const students2 = myClassmates.concat(mySenior); | |
console.timeEnd("Native concat"); | |
console.time("Lodash concat"); |
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
<<< ATTENTION >>> | |
THIS GIST WILL BE MIGRATED TO THE REPOSITOY LINK PROVIDED BELOW TO MAKE IT MORE MEANINGFUL | |
AND EASY TO NAVIGATE THROUGH THE RESOURCES AND THIS GIST WILL BE NO LONGER MAINTAINED STARTING FROM 19TH JUNE 2022 | |
https://github.com/harithzainudin/absolutely-developer | |
------------------------ | |
Awesome roadmaps of everything | |
https://github.com/liuchong/awesome-roadmaps#programming-language |
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
service: service-a | |
frameworkVersion: "3" | |
provider: | |
name: aws | |
runtime: nodejs14.x | |
region: ap-southeast-1 | |
stage: dev | |
environment: | |
API_GATEWAY_NAME: ${self:service}-${sls:stage}-apigw | |
API_GATEWAY_ROOT_RESOURCE_ID: ${self:service}-${sls:stage}-apigw-root-resource-id |