Skip to content

Instantly share code, notes, and snippets.

View suejungshin's full-sized avatar

Suejung Shin suejungshin

View GitHub Profile

Keybase proof

I hereby claim:

  • I am suejungshin on github.
  • I am suejungshin (https://keybase.io/suejungshin) on keybase.
  • I have a public key ASAQt7Bs81AxSJT0llLzdIOQoHGXnvzLqZmsXDt3-Kdz4Qo

To claim this, I am signing this object:

@suejungshin
suejungshin / gist:22ddb2ebfd996ddc8c2966e9a87087fd
Created January 11, 2020 00:49
Make adjustments in service architecture
Nginx proxy/load balancer
/ \
Node server 1 Node server 2
\ /
Postgres DB
https://imgur.com/a/J80Qllz
Transaction traces
Sample performance details
Date Transaction / Details App server
01/09 10:32 — about 14 hours ago
get /
/
2,846 ms
01/09 10:28 — about 14 hours ago
get /
@suejungshin
suejungshin / gist:8d1c0a2fe22848e572d65b3156a16f39
Created January 4, 2020 22:42
Sample artillery run for proxy
config:
target: 'http://localhost:3000/?id=10000000'
phases:
- duration: 100
arrivalRate: 1000
defaults:
headers:
x-my-service-auth: '987401838271002188298567'
scenarios:
- flow:
@suejungshin
suejungshin / gist:6052b5b1cd31fa6cb68b58ac1cbaa58e
Created January 4, 2020 19:05
Sample artillery run for service
config:
target: 'http://localhost:3001/?id=10000000'
phases:
- duration: 100
arrivalRate: 1000
defaults:
headers:
x-my-service-auth: '987401838271002188298567'
scenarios:
- flow:
** Postgres query
select * from properties join zips on properties.zip_code = zips.zip_code where property_id = 200000;
property_id | zip_code | property_cost | home_insurance_rate | hoa_monthly_dues | construction_year | zip_code | property_tax_rate
-------------+----------+---------------+---------------------+------------------+-------------------+----------+-------------------
200000 | 11979 | $1,010,000.00 | 0.280 | $850.00 | 1928 | 11979 | 0.914
(1 row)
** Cassandra query
select * from perch_dev.properties where property_id = 10000000;
property_id | construction_year | hoa_monthly_dues | home_insurance_rate | property_cost | zip_code
@suejungshin
suejungshin / Sample API call
Last active December 2, 2019 07:49
Sample API call
// Client side
getAnalystRatings () {
$.ajax({
method: 'GET',
url: 'http://localhost:3000/analystRatings',
success: (data) => {
this.setState(
{analystRatings: data}
)
console.log('Get request successful: ', data);
@suejungshin
suejungshin / Week4-Interview-Problem
Created November 21, 2019 17:59
Week4-Interview-Problem
class CashAmount {
constructor(value) {
this.inputDouble = value;
this.inputPennies = this.turnDoubleIntoPennies(this.inputDouble);
this.currentTotalInPennies = this.inputPennies;
this.turnDoubleIntoPennies = this.turnDoubleIntoPennies.bind(this);
@suejungshin
suejungshin / gist:a240fef8fbbcf64f25907ad3b5521639
Created October 31, 2019 16:11
Suejung Shin Week 2 interview prompt
/**
* @param {number} numRows
* @return {number[][]}
*/
var generate = function(numRows) {
if (numRows === 0) {
return [];
}
if (numRows === 1) {
return [[1]];