Skip to content

Instantly share code, notes, and snippets.

View kaenova's full-sized avatar
👋
Balo!

Kaenova Mahendra Auditama kaenova

👋
Balo!
View GitHub Profile
@kaenova
kaenova / README.md
Created May 3, 2025 06:12
Markov Chain Learning

Markov Chain Learning

So i just learn Markov Chain by usecases. The use case are, we want to know what the next product and user's space will be used. In here i encode the state as [current_balance, age_category, product_1, product_2, product_3, product_4]. So if i have [1, 2, 1, 3, 2, 0] It means, the users have low balance (elm 0), he's a teenager (elm 1), have savings as his first product (elm 2), have credit card as his second product (elm 4), have mobile banking as his third product (elm 3), and doesn't have any deposits (elm 5).

I creaete 3 files

  • generator.py to create random users timeline that the product used
  • markov.py create markov chain table
  • interact to interact with the table
@kaenova
kaenova / Next JS Environment Docker Github Action.md
Last active April 30, 2025 10:21
Injecting Next Js Application Environment in Build and Runtime Environment

Inject Next Js Environment Variable in Github Action and Docker

So you're wondering how can i inject my environment variable easily without hardcoding it into a file? Easy use Github Action Environment Variables and also Docker Args.

Github Action

# Web service in development branch (main)

name: LMNTS - Dev - web
@kaenova
kaenova / mock.csv
Created January 14, 2024 04:55
Mock Data of CSV text file column
text
Praesent id massa id nisl venenatis lacinia. Aenean sit amet justo. Morbi ut odio.
Phasellus in felis. Donec semper sapien a libero. Nam dui.
Phasellus sit amet erat. Nulla tempus. Vivamus in felis eu sapien cursus vestibulum. Proin eu mi. Nulla ac enim. In tempor, turpis nec euismod scelerisque, quam turpis adipiscing lorem, vitae mattis nibh ligula nec sem.
Duis bibendum. Morbi non quam nec dui luctus rutrum. Nulla tellus.
Pellentesque at nulla. Suspendisse potenti. Cras in purus eu magna vulputate luctus.
Proin interdum mauris non ligula pellentesque ultrices. Phasellus id sapien in sapien iaculis congue. Vivamus metus arcu, adipiscing molestie, hendrerit at, vulputate vitae, nisl.
Aenean lectus. Pellentesque eget nunc. Donec quis orci eget orci vehicula condimentum.
@kaenova
kaenova / middleware_multer_del.ts
Last active October 9, 2023 15:12
A middleware for automatically remove temporary multer middleware files after the response is close
import { unlinkSync } from "node:fs"
import { Request, Response, NextFunction } from "express"
async function temporaryFileRemoverMiddleware(
req: Request,
res: Response,
next: NextFunction,
) {
async function asyncUnlink(path: string) {
unlinkSync(path);
@kaenova
kaenova / kota-kabupaten-2023-09-29.json
Last active September 29, 2023 12:11
Daftar Kabupaten/Kota Indonesia 2023 - 09 - 29
["Kabupaten Aceh Barat", "Kabupaten Aceh Barat Daya", "Kabupaten Aceh Besar", "Kabupaten Aceh Jaya", "Kabupaten Aceh Selatan", "Kabupaten Aceh Singkil", "Kabupaten Aceh Tamiang", "Kabupaten Aceh Tengah", "Kabupaten Aceh Tenggara", "Kabupaten Aceh Timur", "Kabupaten Aceh Utara", "Kabupaten Bener Meriah", "Kabupaten Bireuen", "Kabupaten Gayo Lues", "Kabupaten Nagan Raya", "Kabupaten Pidie", "Kabupaten Pidie Jaya", "Kabupaten Simeulue", "Kota Banda Aceh", "Kota Langsa", "Kota Lhokseumawe", "Kota Sabang", "Kota Subulussalam", "Kabupaten Asahan", "Kabupaten Batu Bara", "Kabupaten Dairi", "Kabupaten Deli Serdang", "Kabupaten Humbang Hasundutan", "Kabupaten Karo", "Kabupaten Labuhanbatu", "Kabupaten Labuhanbatu Selatan", "Kabupaten Labuhanbatu Utara", "Kabupaten Langkat", "Kabupaten Mandailing Natal", "Kabupaten Nias", "Kabupaten Nias Barat", "Kabupaten Nias Selatan", "Kabupaten Nias Utara", "Kabupaten Padang Lawas", "Kabupaten Padang Lawas Utara", "Kabupaten Pakpak Bharat", "Kabupaten Samosir", "Kabupaten Serdang B
@kaenova
kaenova / glints_data.csv
Created September 27, 2023 13:18
Dataset Example from Glints Scraping
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
Job Title,Company,Location
Freelance Trade Finance Professional,Trdfin Support Service Pvt Ltd,"Kejaksan, Cirebon, Jawa Barat, Indonesia"
Freelance Trade Finance Professional,Trdfin Support Service Pvt Ltd,"Bumi Raya, Kab. Morowali, Sulawesi Tengah, Indonesia"
Freelance Trade Finance Professional,Trdfin Support Service Pvt Ltd,"Taman Sari, Pangkal Pinang, Kepulauan Bangka Belitung, Indonesia"
Freelance Trade Finance Professional,Trdfin Support Service Pvt Ltd,"Rumbai, Pekanbaru, Riau, Indonesia"
Freelance Trade Finance Professional,Trdfin Support Service Pvt Ltd,"Tatanga, Palu, Sulawesi Tengah, Indonesia"
Freelance Trade Finance Professional,Trdfin Support Service Pvt Ltd,"Semarang Tengah, Semarang, Jawa Tengah, Indonesia"
Translation Mandarin Specialist,Pt Qinfa Mining Industri,"Banjarmasin Barat, Banjarmasin, Kalimantan Selatan, Indonesia"
Senior Software Engineer (Remote),EarnAha,"Rungkut, Surabaya, Jawa Timur, Indonesia"
Marketing Staff,PT VPlus Platinum 8 Indonesia,"Setiabudi, Jakarta Selatan, DKI Jakart
@kaenova
kaenova / glints_scraping.py
Created September 27, 2023 13:12
Example of Glints Data Scraping
import csv
import requests
from bs4 import BeautifulSoup
csv_file_path = 'jobs.csv'
num_data = 500
page_number = 1
job_data = []
@kaenova
kaenova / python proto.sh
Created September 23, 2023 04:47
Python Compile protoc
# For compiling to c
python -m grpc_tools.protoc \
-I./proto \
--python_out=./py-script/rpc \
--pyi_out=./py-script/rpc \
--grpc_python_out=./py-script/rpc \
./proto/*.proto
# For changing into relative import
sed -i 's/import \(\w\+\)_pb2 as \(\w\+\)__pb2/from . import \1_pb2 as \2__pb2/' \
py-script/rpc/*_grpc.py
@kaenova
kaenova / Recursion component on creating heading.tsx
Last active February 19, 2023 10:07
Recursion Components with Callback function
// These are custom component, you can change it to your liking
import MainButton from '@/components/button/MainButton';
import InputText from '@/components/input/InputText';
import React, { useEffect, useState } from 'react';
function Test() {
return (
<div className="flex flex-col w-screen h-screen items-center justify-center">
<div className="w-5/12 rounded-md p-3 border border-neutral-500/20 shadow-md bg-white">
<Headers onChange={(data) => console.log(data)} />
@kaenova
kaenova / K3s notes.md
Created July 7, 2022 10:10
Install K3s without Traefik

How to install K3s without built in traefik?

# source: https://www.suse.com/support/kb/doc/?id=000020082
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--no-deploy traefik" sh -s -