<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
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
#!/bin/bash | |
# THIS SCRIPT DEPENDS ON: | |
# aws cli: https://aws.amazon.com/cli/ | |
# jq https://stedolan.github.io/jq/ | $ brew install jq | |
i=0 | |
NEXT_ID="" | |
GROUP_NAME="/aws/lambda/prod-some-service" | |
STREAM_NAME="2022/08/03/[\$LATEST]some-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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"os" | |
"os/exec" | |
"path" | |
"strings" | |
"sync" |
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
#!/bin/bash | |
# SPEEDS UP CSV SORTING (~2X) BY DISTRIBUTING THE LOAD INTO 8 DIFFERENT PROCESSES | |
# USAGE: $ < <input-csv-file> ./csv-tr-sort.sh -c <column-name-to-sort> -o <sort-direction=1,-1> > sorted.csv | |
# AVERAGES ~22 SECONDS SORTING A 300MB CSV FILE WITH 3MM ENTRIES ON AN M1 | |
ORDER=1 | |
usage() { echo "Usage: $0 [-c <column-name>] [-o <order=1,-1>]" 1>&2; exit 1; } |
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
#!/bin/bash | |
# prints remote github-url | |
function ghr () { | |
GITHUB_REMOTE=$(git config --get remote.origin.url) | |
if [ $? -eq 1 ]; then | |
echo "either not a github repo or remote not found 😙" | |
return 1 | |
fi | |
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
perl -n -e'/(\d+) events processed!/ && print $1' |
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
#!/usr/bin/env bash | |
SRC_URI=<source-connection-uri> | |
SRC_DB=<source-database-name> | |
DST_URI=<destination-connection-uri> | |
DST_DB=<destination-database-name> | |
FLOW=1000 | |
mongodump --archive --uri $SRC_URI --db $SRC_DB | mongorestore --archive --uri $DST_URI --db $DST_DB --numInsertionWorkersPerCollection=$FLOW |
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
/** | |
* As part of a technical on-site screening-interview I was requested to create a function | |
* able to find two numbers in array `arr` that added together would equal given number `k`. | |
* | |
* I initially did an approach equal to run the function below with the option `reduceIterations=false`. | |
* | |
* My interviewer asked if I had a better approach: honestly, not only I had a headache but also I was already screened | |
* remotely and was not expecting more coding review: especially on the spot. I don't know, first time interviewing | |
* in the US... The thing is, he suggested using a 'table hash' (first time I heard the term) to reduce iteration. At | |
* the beginning I did not understand him (probably due to my technical language barer) but then I realized he wanted |
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
/** | |
* As part of a technical screening interview I was requested to create a function | |
* able to perform a binary search. | |
* | |
* @param {Number[]} arr - A sorted array | |
* @param {Number} k - Number to find | |
* @return {Number} index position where k was found in the array | |
* | |
* @see: https://en.wikipedia.org/wiki/Binary_search_algorithm | |
*/ |
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
/** | |
* As part of a technical screening interview I was requested to create a function | |
* able to calculate the total score of a game after all of the given rounds were completed | |
* following the criteria below: | |
* | |
* The function receives an array of strings restricted to the following operation: | |
* Integer: Directly represents the number of points scored this round. | |
* +: The points scored this round are the sum of the last two valid round's points. | |
* D: The points scored this round are double the last valid round's points. | |
* C: The last valid round's points were invalid and should not be counted towards the total score or any future operations. |
NewerOlder