- The concept or the WHY we need this PR ?
- Definition/Motivation/Logic
- Define my own Test cases and compare with PR's test cases
- Migration
- Code review, if any changes effect the logic, waiting for update, then do Code Review again
- In the quick scan, does any code break the app
- Need to update environment variables ? if yes, wait for update then check again
- Need to update package.json, package-lock.json
- Code base convention: does files structure follow the current code base convention ?
- Code base Screaming principle: does files name present its main logic ?
This file contains hidden or 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
// Using ES 6, shortest and most readable solution | |
(new Set(myArray)).size !== myArray.length | |
// Using Array.some, this is fastest solution | |
myArray.some((value, index, array) => array.includes(value, index + 1)) | |
// Using filter | |
passphrases.filter(function (value, index, self) { return self.indexOf(value) === index; }).length !== passphrases.length | |
// Source for benchmark: https://jsbench.me/mqjvw8exl9 |
This file contains hidden or 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
DO $$ BEGIN | |
CREATE TYPE public.import_deliveries_delivery_state_enum AS ENUM | |
('10', '20'); | |
EXCEPTION | |
WHEN duplicate_object THEN null; | |
END $$; |
This file contains hidden or 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 { createToken, Lexer, CstParser } from 'chevrotain'; | |
const Identifier = createToken({ | |
name: 'Identifier', | |
pattern: /([\d\.]+|[\d\w]+)/, | |
}); | |
const Amount = createToken({ | |
name: 'Amount', | |
pattern: /\d+\.*\d*/, | |
longer_alt: Identifier, |
This file contains hidden or 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
async function execute() { | |
// processing ... | |
await new Promise((resolve) => { | |
setTimeout(async () => { | |
await execute(); | |
resolve(); | |
}, 1000); | |
}); | |
} |
This file contains hidden or 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type People struct { | |
FirstName string `json:"first_name"` | |
LastName string `json:"last_name"` |
This file contains hidden or 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 logClass(target: any) { | |
// save a reference to the original constructor | |
var original = target; | |
// a utility function to generate instances of a class | |
function construct(constructor, args) { | |
var c : any = function () { | |
return constructor.apply(this, args); | |
} |
This file contains hidden or 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 | |
# Install Apache server | |
yum update -y | |
yum install -y httpd.x86_64 | |
systemctl start httpd.service | |
systemctl enable httpd.service | |
echo "Hello world $(hostname -f)" > /var/www/html/index.html |
This file contains hidden or 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
{ | |
"moduleFileExtensions": ["js", "json", "ts"], | |
"rootDir": ".", | |
"testEnvironment": "node", | |
"testRegex": ".e2e-spec.ts$", | |
"verbose": true, | |
"transform": { | |
"^.+\\.(t|j)s$": "ts-jest" | |
}, | |
"moduleNameMapper": { |
This file contains hidden or 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
provider "aws" { | |
region = "ap-southeast-1" | |
} | |
variable "server_port" { | |
description = "The port the server will use for HTTP requests" | |
type = number | |
default = 80 | |
} |