Skip to content

Instantly share code, notes, and snippets.

View indiejoseph's full-sized avatar
🏠
Working from home

Joseph Cheng indiejoseph

🏠
Working from home
View GitHub Profile
@indiejoseph
indiejoseph / fullstack_dev_test.md
Last active August 30, 2021 17:44
Fullstack Developer Test

Fullstack Developer Test

The goal of this test is to evaluate your ability to architecture a small full-stack NodeJS app.

Instruction

The app you need to build is a small admin page. The initial dataset is dummy user profiles on dummyapi.io.

The app is comprised of 2 parts:

The node backend, responsible for handle API request:

@indiejoseph
indiejoseph / getYearByMonthDateAndWeekday.js
Created August 2, 2020 15:23
Find a possible years for the given month date and weekday
function getYearByMonthDateAndWeekday (month, date, weekday) {
const now = new Date();
const startYear = 2013;
const endYear = now.getFullYear();
const possibleYears = Array.from(new Array((endYear - startYear) + 1)).map((_, i) => startYear + i).sort((a, b) => b - a);
const validYears = possibleYears.filter((year) => {
const thisYear = new Date(year, month - 1, date);
return thisYear.getDay() === weekday;
[
{ "name": "contact_id", "type": "INTEGER", "mode": "REQUIRED" },
{ "name": "firstname", "type": "STRING" },
{ "name": "lastname", "type": "STRING" },
{ "name": "client_address", "type": "STRING" },
{ "name": "gender", "type": "STRING" },
{ "name": "level_of_dependence", "type": "STRING" },
{ "name": "cg_rank", "type": "STRING" },
{ "name": "update_date", "type": "INTEGER" },
{ "name": "special_request_free_text", "type": "STRING" },
@indiejoseph
indiejoseph / gist:da94e42def34a31d450060bc4d95f924
Created June 18, 2020 05:41
Get number of message in topic | Kafka
$KAFKA_HOME/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --topic topic --broker-list=kafka:9092
@indiejoseph
indiejoseph / kafkacat
Last active June 22, 2020 03:55
kafkacat
docker run -it --rm edenhill/kafkacat:1.5.0 -b kafka.test.com:9093 -L
@indiejoseph
indiejoseph / kafka_check_message.sh
Created June 16, 2020 09:38
check Kafka message
$KAFKA_HOME/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
@indiejoseph
indiejoseph / kafka_create_topic.sh
Created June 16, 2020 07:02
KAFKA create topic
$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper $ZK --replication-factor 1 --partitions 2 --topic topic
@indiejoseph
indiejoseph / dnc.csv
Last active May 28, 2020 07:08
dnc.csv
We can't make this file beautiful and searchable because it's too large.
phone
51000003
51000024
51000094
51000101
51000411
51000460
51000505
51000569
51000605
@indiejoseph
indiejoseph / denzt-stack.md
Last active May 28, 2020 01:03
Denzt tech stack

Backend Stack

  • NestJS
  • Google SQL(MySQL)
  • Typescript
  • RxJS

Frontend Stack

  • NextJS
  • React
  • styled-components
@indiejoseph
indiejoseph / gist:4b2a077329366c49e053b66dd3fcaa8b
Last active May 22, 2020 13:35
Ngnix Docker + Letsencrypt
docker run -d -p 80:80 -p 443:443 \
--name nginx-proxy \
--restart always \
--network service-network \
-v $HOME/certs:/etc/nginx/certs:ro \
-v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true \
jwilder/nginx-proxy