Skip to content

Instantly share code, notes, and snippets.

@virtcoder
virtcoder / Get - 100 RPS
Created August 7, 2021 18:31
K6 Stress Test
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
execution: local
script: stressTest/get.js
output: -
@virtcoder
virtcoder / Config
Created August 3, 2021 00:22
K6 stress test on proxy
import http from 'k6/http';
import { check } from 'k6';
export let options = {
scenarios: {
constant_request_rate: {
executor: "constant-arrival-rate",
rate: 10000,
timeUnit: "1s",
duration: "120s",
@virtcoder
virtcoder / Get - 100 RPS
Last active August 7, 2021 18:18
K6 stress tests
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
execution: local
script: stressTest/get.js
output: -
O: number of steps needed to cut off all the trees in the matrix m x n
I: multidimensional arrays of rows and columns
C: if there are more than one possible paths, need to go to the
next taller tree
E: there is only one tree possible to cut off
steps:
example 1:
as long as the coordinate is within the size of the row and column
@virtcoder
virtcoder / postgresDBQuery.txt
Last active July 12, 2021 01:15
Postgres DB operation
SELECT count(author_id) FROM public.author;
10000000
SELECT * from author WHERE author_id = 7000000;
author_id | first_name | middle_name | last_lame | job | employer | rating | reviews | students | courses | thumbnail | bio | created_at | updated_at
7000000 | Marjorie | Brionna | Grimes | Regional Usability Planner | McCullough | 3.6 | 34863 | 589912 | 35 | https://authors-avatar.s3.amazonaws.com/6000000.jpg | Marjorie Brionna Grimes has a BS in National. | 2021-07-10 11:25:24 |
UPDATE author SET updated_at = created_at where author_id = 7000000;
UPDATE 1
Partition List
* @param {string} s
* @return {number}
*/
var numDecodings = function(s) {
//create counter var
//create traversal func- takes in start and end index
//edge case
// if we are at end of string
// increase counter
//recursion
@virtcoder
virtcoder / ListingHeaderApi.js
Last active May 12, 2021 02:53
Listing header
http://localhost:5001/api/listingheader/:listingId
http://localhost:5001/api/listingheader/1
[{"id":1,"listingName":"Quiet Garden View Room & Super Fast WiFi","listingDescription":"One of a kind Pirate Ship!\nLocated 4 min from MSP Airport. Marina is surrounded by nature. The Ship is 65' long, has two bedrooms, two heads, a hammock and numerous nooks to hideout at. Shower, kitchen, central air, big upper deck, planks, fireplace, tables and couches, tunes, and theme lighting.\nGated marine, plenty parking. Gangplank takes you directly to the Ship. SUP?S & kayaks.\n$350 1-6 people. 2 Bedrooms.\nParties are temporarily not allowed.\nFoul weather limits top deck use. Arrrrr!","hostId":46,"review":278,"rating":4.5,"address1":"1745 T Street Southeast","address2":"","city":"Washington","state":"District of Columbia","zipCode":"20020","country":"United States","accomodates":2,"numberOfBathrooms":"1.5","numberOfBedrooms":1,"numberOfBeds":2}]
http://localhost:5002/api/listingdescription/:listingId
http://localhost:500