Skip to content

Instantly share code, notes, and snippets.

View tfkhdyt's full-sized avatar
🇵🇸
Free Palestine

Taufik Hidayat tfkhdyt

🇵🇸
Free Palestine
View GitHub Profile
@tfkhdyt
tfkhdyt / tsconfig.json
Created March 26, 2025 02:23
Type-safety tsconfig
{
"compilerOptions": {
"strict": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
@tfkhdyt
tfkhdyt / settings.json
Created September 10, 2024 08:13
My vscodium settings
{
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@tfkhdyt
tfkhdyt / github-actions-docker.yaml
Created August 23, 2024 13:47
How to build docker image in github actions
name: Build and Deploy
on:
push:
branches:
- master
jobs:
migrate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@tfkhdyt
tfkhdyt / create-fiber-app
Last active March 8, 2024 02:42
Create Fiber App
#!/usr/bin/bash
set -euo pipefail
printf "Package name? "
read -r PACKAGE_NAME
if [[ -z "$PACKAGE_NAME" ]]; then
echo "Error: package name should not be empty"
exit 1
fi
@tfkhdyt
tfkhdyt / ws.js
Last active January 24, 2024 00:06
Node.js websocket example
const WebSocket = require("ws");
const ws = new WebSocket("wss://xapi.netovas.app/auth/inspect/ws");
ws.on("error", console.error);
ws.on("open", () => {
ws.send(
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDY2MjE0MjAsImlkIjoxNzAzMDY5NDU4NTcyLCJyb2xlIjoicGFydG5lciJ9.m3h_XqTI-aGZPS4obnoKVfivDXy0cnVIQnoqQlqZNVA",
);
@tfkhdyt
tfkhdyt / another-example.conf
Last active January 28, 2024 08:21
NGINX Reverse Proxy
server {
server_name api.gananwo.click;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
@tfkhdyt
tfkhdyt / yuuko-alert.sh
Created December 25, 2023 00:46
Yuuko Alert
#!/usr/bin/env bash
yad \
--info --text 'Selamat Pagi !' --title 'Yuuko Alert' \
--image './yuuko_selamat_pagi_greeting-75.png' --button="OK:0" \
--width 200 --height 150 --text-align 'center' --buttons-layout 'center' \
--center
@tfkhdyt
tfkhdyt / History|-102bdcdd|entries.json
Last active June 22, 2024 12:42
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///home/tfkhdyt/projects/netovas/crm-netovas-backoff/client/client_route.go","entries":[{"id":"ZcnH.go","timestamp":1710397371186},{"id":"Ujhy.go","source":"Organize Imports","timestamp":1710470627558},{"id":"Jjcq.go","source":"moved.source","timestamp":1710472172457},{"id":"mblm.go","timestamp":1710472192159},{"id":"33sp.go","timestamp":1710472249851},{"id":"MtLU.go","source":"Renaming AddClient to add","timestamp":1710472394769},{"id":"zTFM.go","source":"Renaming FindAll to findAll","timestamp":1710472402815},{"id":"tP6Y.go","timestamp":1710476227501},{"id":"klSK.go","timestamp":1710483090202},{"id":"kezv.go","timestamp":1710484547515},{"id":"6Fxj.go","source":"Renaming Admin to AdminGuard","timestamp":1710484561522},{"id":"CWPr.go","timestamp":1710739286391},{"id":"5gRX.go","timestamp":1710745959658},{"id":"4EZc.go","source":"Renaming Handler to ClientHandler","timestamp":1710753151419},{"id":"U22d.go","timestamp":1710753497427},{"id":"8cqf.go","timestamp":1710815241340},{"id"
@tfkhdyt
tfkhdyt / service-name.service
Created February 8, 2023 01:34
Simple Systemd service example
[Unit]
Description=Service description
[Service]
Type=simple
User=admin
WorkingDirectory=/home/admin/project-name
ExecStart=/usr/bin/node /home/admin/project-name/dist/index.js
Restart=on-failure
@tfkhdyt
tfkhdyt / programs-that-i-use-everyday.md
Last active January 26, 2023 23:58
Programs that I use everyday