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
# new line + workdir + $ | |
export PS1="\n\w $ " | |
export PROMPT_DIRTRIM=2 |
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 ( | |
"strconv" | |
) | |
func solution(A []int, B []int) int { | |
n := len(A) | |
graph := make([][]int, n+1) | |
// track visited nodes when traversing the graph |
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 ( | |
"fmt" | |
"time" | |
) | |
const ( | |
NUM_WORKERS = 100 | |
NUM_JOBS = 1000 |
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 ( | |
"fmt" | |
"sync" | |
) | |
const ( | |
NUM_WORKERS = 10 | |
NUM_JOBS = 10000 |
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
name: kafka_cluster | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:7.5.3 | |
container_name: zookeeper | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
ports: |
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
name: Deploy SPA | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
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
name: Build SPA | |
on: | |
pull_request: | |
types: [opened, edited, synchronize, reopened, closed] | |
branches: | |
- main | |
jobs: | |
build: |
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
function formatMemoryUsage(data: number) { | |
return `${Math.round((data / 1024 / 1024) * 100) / 100} MB`; | |
} | |
function getCurrentMemoryUsage(): Object { | |
const memoryData = process.memoryUsage(); | |
return { | |
rss: `${formatMemoryUsage(memoryData.rss)} -> Resident Set Size - total memory allocated for the process execution`, | |
heapTotal: `${formatMemoryUsage(memoryData.heapTotal)} -> total size of the allocated heap`, |
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
import { | |
CognitoJwtVerifier, | |
CognitoJwtVerifierSingleUserPool, | |
} from 'aws-jwt-verify/cognito-verifier'; | |
const verifier: CognitoJwtVerifierSingleUserPool<{ | |
userPoolId: string; | |
tokenUse: 'access' | 'id'; | |
clientId: string; | |
}> = CognitoJwtVerifier.create({ |
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
# Install build dependencies for ruby(https://github.com/rbenv/ruby-build/wiki#suggested-build-environment) | |
sudo apt-get install -y autoconf bison patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev | |
# Install rbenv using git | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc | |
source ~/.bashrc | |
# Install ruby-build plugin for rbenv | |
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build | |
# List available ruby versions | |
rbenv install --list |
NewerOlder