Alias | Command |
---|---|
gaa | git add --all |
gcmsg | git commit -m |
ggp | git push origin $(current_branch) |
gcm | git checkout $(git_main_branch) |
grhh | git reset --hard |
gcb | git checkout -b |
gsta | git stash push |
gstd | git stash drop |
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 the followings in the vscode settings.json | |
// Credit: James King | |
"explorer.fileNesting.patterns":{ | |
"*.ts": "${capture}.test.ts", | |
"*.go": "${capture}_test.go", | |
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts, ${capture}.test.js", | |
"*.jsx": "${capture}.test.jsx", | |
"*.tsx": "${capture}.test.tsx", | |
"tsconfig.json": "tsconfig.*.json", |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
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
// filtering alphanumeric with isLetterOrDigit | |
// convert a char to lower with toLower | |
val string: String = "A man, a plan, a canal: Panama" | |
string.toCharArray.filter(_.isLetterOrDigit).map(_.toLower) | |
// convert a string to lower case | |
string.toLowerCase() | |
// ========================================================================= // | |
// partial function demo with chaining // |
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 TABLE user( | |
user_id varchar(50) PRIMARY KEY, | |
name varchar(50) | |
); | |
CREATE TABLE devices( | |
device_id varchar(50) PRIMARY key, | |
user_id varchar(50) not null, | |
foreign key(user_id) references user(user_id) |
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
query { | |
getCourseDetails( | |
courseId: 123 | |
) { | |
title | |
description | |
ratings | |
numOfStudents | |
reviews { | |
review |
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
Proxy type | % CPU | Number of OS threads | Memory (MB) | |
---|---|---|---|---|
Spring Boot proxy | 7.2 | 46 | 124.2 | |
Go Proxy | 0.1 | 26 | 7.8 |
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
Number of Requests | Standard Deviation (Spring Boot - Golang) | Throughput req/sec (Spring Boot - Golang) | Avg (Spring Boot - Golang) | Min (Spring Boot - Golang) | Max (Spring Boot - Golang) | Received KB/sec (Spring Boot - Golang) | Avg Bytes (Spring Boot - Golang) | Notes | |
---|---|---|---|---|---|---|---|---|---|
10000 | 4.14 --- 2.70 | 100.77801 --- 101.02337 | 2 --- 0 | 1 --- 0 | 208 --- 150 | 95.14 --- 88.99 | 966.7 --- 902.0 | Ramp up period 100s | |
20000 | 7.82 --- 2.79 | 100.36483 --- 100.47373 | 3 --- 0 | 1 --- 0 | 342 --- 125 | 94.75 --- 88.50 | 966.7 --- 902.0 | Ramp up period 100s | |
30000 | 5.85 --- 2.34 | 299.98200 --- 301.09599 | 3 --- 0 | 1 --- 0 | 275 --- 119 | 283.20 --- 265.22 | 966.7 --- 902.0 | Ramp up period 100s | |
30000 | 14.20 --- 3.19 | 150.07654 --- 150.38348 | 5 --- 0 | 1 --- 0 | 495 --- 125 | 141.68 --- 88.50 | 966.7 --- 902.0 | Ramp up period 200s | |
30000 | 5.00 --- 2.89 | 100.26671 --- 100.31834 | 2 --- 0 | 0 --- 0 | 245 --- 121 | 94.66 --- 88.37 | 966.7 --- 902.0 | Ramp up period 300s | |
80000 | 11.63 --- 3.49 | 199.98850 --- 200.20772 | 4 --- 0 | 1 --- 0 | 497 --- 168 | 188.8 --- 176.35 | 966.7 --- 902.0 | Ramp up perio |
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
{ | |
"StartAt": "InvokeLambdaState", | |
"States": { | |
"InvokeLambdaState": { | |
"Type": "Task", | |
"Resource": "arn:aws:lambda:us-east-2:XXXXXXX:function:step-function-invoking-lambda-function", | |
"Parameters": { | |
"target_value": 9 | |
}, | |
"Next": "CheckStatusFromLambda" |
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
def lambda_handler(event, context): | |
target_value = event['target_value'] | |
print("Lambda is Invoked with the Integer:: ", target_value) | |
nums = [-1,0,3,5,9,12] | |
found, index = search(nums, target_value) | |
if found: |
NewerOlder