Skip to content

Instantly share code, notes, and snippets.

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

AING TECKCHUN Teckchun

🏠
Working from home
View GitHub Profile
@Teckchun
Teckchun / mysql-docker.sh
Created October 18, 2022 09:57 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@Teckchun
Teckchun / axios-catch-error.js
Created January 10, 2022 05:02 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@Teckchun
Teckchun / benchmark-commands.md
Created June 19, 2019 09:11 — forked from ueokande/benchmark-commands.md
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \