Skip to content

Instantly share code, notes, and snippets.

Switch JDK versions on Mac OS

Install jenv

$ brew install jenv

Add jenv to PATH variable in shell

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT:$GOPATH:$GOBIN
@ng-the-engineer
ng-the-engineer / README.md
Last active July 26, 2020 17:43
Setup DynamoDB in a local machine

Setup Local DynamoDB

  1. Download local DynamoDB
  2. Unzip to a local folder
> mkdir ~/mydynamodb
> cd ~/mydynamodb
> unzip -a ~/Downloads/dynamodb_local_latest.zip
@ng-the-engineer
ng-the-engineer / README.md
Created July 26, 2020 17:48
Setup AWS credential for local DynamoDB

Local AWS credential

  1. Run
> aws configure
  1. In the prompt, you may enter arbitrary values for Access Key ID and Secret Access Key. Use 'local' for region name
@ng-the-engineer
ng-the-engineer / README.md
Created July 26, 2020 17:51
Local DynamoDB GUI tool

Setup a database GUI client dynamodb-admin

  1. install the node library as global
> npm install dynamodb-admin -g
  1. Run dynamodb-admin by pointing to the local server endpoint
@ng-the-engineer
ng-the-engineer / READMe.md
Created July 26, 2020 17:54
Create model in local DynamoDB example

Create model programmatically

  1. Create a Json file mymodel.json for a basic model
{
  "TableName": "YOUR_TABLE_NAME",
  "KeySchema": [
    {
 "AttributeName": "KEY_COLUMN_NAME",
@ng-the-engineer
ng-the-engineer / README.md
Last active October 5, 2020 08:06
ES2015 babel setup

ES6 babel setup

  1. Install Babel
$ npm install -D babel-cli babel-preset-es2015
  1. Create .babelrc in root folder
@ng-the-engineer
ng-the-engineer / README.md
Last active September 25, 2020 16:47
Setup ES2020

Install @babel/cli, @babel/core, @babel/node, and @babel/preset-env

yarn add --dev @babel/cli @babel/core @babel/node @babel/preset-env

Create .babelrc

{
@ng-the-engineer
ng-the-engineer / README.md
Last active September 30, 2020 03:55
Install Redis-cli

Redis-cli

Redis-cli allows you to access Redis instance. Run below command to install.

brew tap ringohub/redis-cli

brew update && brew doctor
@ng-the-engineer
ng-the-engineer / README.md
Created September 21, 2020 09:33
Run redis official container
1. Redis

Redis is used to support the message queue. Run below command to run the offical Redis container

$ docker run --name my-redis-container -p 6379:6379 -d redis

(Optional) To access Redis, check this gist