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 / IMAGE UPLOAD ON COMMENT FIELD.txt
Created May 22, 2022 13:40
IMAGE UPLOAD ON COMMENT FIELD
IMAGE UPLOAD ON COMMENT FIELD
# Membagi 'a' menjadi 'b' bagian
a = [1,2,3,4,5,6,7,8,9,10,11]
b = 3
new_arr = []
for i in range(b):
if i == 0:
new_arr.append(a[:(i+1)*(int(np.ceil(len(a)/b)))])
else:
@kaenova
kaenova / TextCleaning.py
Created August 20, 2021 04:29
Indonesian Text Cleaning with Sastrawi Library
import pandas as pd
import re
import string
from tqdm import tqdm
from Sastrawi.Stemmer.StemmerFactory import StemmerFactory
class DataCleaning:
# Initialization
factory = StemmerFactory()
stemmer = factory.create_stemmer()
@kaenova
kaenova / kFoldList.py
Last active June 2, 2021 06:32
K-Fold from a List Implementation in Python
def kFold(list, totalFold):
# Pre-requisite check
if totalFold > len(list):
raise Exception("TotalFold can't be more than total element in the list")
# Variable initialization
fold = []
current_element = 0
element_per_fold = len(list) // totalFold
modulus_counter = len(list) % totalFold
- All about Kubernetes -
You need to install docker, kubernete or minikube(only runs on local), and kubectl
Node is a machine (it can be a baremetal computer or a VM)
Pod is a container that contain a "docker container"
Creating pods
$ kubectl create -f [yaml file]
See running pods
- All about Docker -
Installing Docker on Ubuntu
https://docs.docker.com/engine/install/ubuntu/
How to deploy a docker container with interactive bash?
$ docker run -d -t --hostname [Nama Hostnya / PCnya] --name [Name of the container] [docker container]
How to see deployed container?
$ docker container ls
@kaenova
kaenova / QuickSort.py
Last active April 3, 2021 14:07
A Quicksort Algorithm in Python
def quicksort(lst, sort='asc'):
#Use 'asc' for ascending sort
#Use 'dsc' for descending sort
if (len(lst) == 1):
return lst
elif (len(lst) == 2):
if sort == 'asc':
if lst[0] >lst[1]:
lst[0], lst[1] = lst[1], lst[0]
return lst