Skip to content

Instantly share code, notes, and snippets.

View rakaadinugroho's full-sized avatar
✍️
Writing a Book

Raka Adi Nugroho rakaadinugroho

✍️
Writing a Book
View GitHub Profile
@rakaadinugroho
rakaadinugroho / postgres.md
Created September 14, 2022 01:41 — forked from phortuin/postgres.md
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql

Run server:

@rakaadinugroho
rakaadinugroho / howto.txt
Created January 6, 2022 14:01
Read Techinasia Article For Free
just open console, and type this script to remove the blocked css
document.getElementsByClassName("paywall-content")[0].classList.remove("paywall-content")
@rakaadinugroho
rakaadinugroho / index.js
Created September 27, 2021 09:08
Calculate Sum Of Content with Infinite Sub Array
const firstNumbers = [
[1, 2, 3, 4, 5], // 5
2, // 1
[1, 2, 3, 4, 5], // 5
4, // 1
[
1, // 1
2, // 1
3, // 1
4, // 1
@rakaadinugroho
rakaadinugroho / index.js
Last active September 21, 2021 23:46
PPH21 Calculation with Javascript
const convertToRupiah = (number) => new Intl.NumberFormat('id-ID', { style: 'currency', currency: 'IDR' }).format(number);
const taxConfig = [
{ range: 50000000, percentage: 0.05 },
{ range: 250000000, percentage: 0.15 },
{ range: 500000000, percentage: 0.25 },
{ range: "all", percentage: 0.30 },
];
const pkps = [540000000, 3000000, 168000000, 248146800, 300000000, 840000000];
@rakaadinugroho
rakaadinugroho / files.c
Created March 17, 2020 15:29
Machine Level Representation Homework
/* 3.55 */
long decode(long x, long y, long z) {
long tmp = y - z;
return (tmp * x) ^ (tmp << 63 >> 63);
}
/* 3.57 */
#include <stdio.h>
#include <assert.h>
@rakaadinugroho
rakaadinugroho / bubble.kt
Created May 20, 2019 06:31
Cracking the Coding Interview #1 Sorting
//written as an extension function. Completely type-safe.
fun ArrayList<Int>.bubbleSort()
: ArrayList<Int>{
var swap = true
while(swap){
swap = false
for(i in 0 until this.indices.last){
if(this[i] > this[i+1]){
val temp = this[i]
this[i] = this[i+1]
@rakaadinugroho
rakaadinugroho / nlp-with.go
Last active September 21, 2018 09:37
NLP Addict
#TFIDF Component
https://github.com/wilcosheh/tfidf
https://github.com/nrshrivatsan/go-tfidf (with Stopwords)
https://github.com/go-nlp/tfidf
#NLP Resource
https://medium.com/@errata.ai/introducing-prose-v2-0-0-bringing-nlp-to-go-a1f0c121e4a5
#Sentiment Analytic
https://github.com/cdipaolo/sentiment
@rakaadinugroho
rakaadinugroho / tutorialgolang3.txt
Created July 17, 2018 01:40
Basic Http : Tutorial Golang Bahasa Indonesia
1. Menambahkan HTTP Package
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
fmt.Fprint(writer, "test browser")
})
http.ListenAndServe(":8080", nil)
2. Create Enpoint (untuk ujicoba)
http.HandleFunc("/test", otherFunc)
3. Http Verb
@rakaadinugroho
rakaadinugroho / tutorialgolang2.txt
Created July 15, 2018 11:53
Tutorial GoLang Bahasa Indonesia - Part 2 (Tipe Data, Struct, Interface, Logika)
1. Starting Write Code
2. Standarisasi Run & Compile
3. Sample Import Package
4. Create function
// Sample Function
func add(x int, y int) int { // x, y int
return x + y
@rakaadinugroho
rakaadinugroho / gist:a14b4d76a74d63e7a8b03ebe656d1968
Last active July 14, 2018 02:42
PART #1 SETUP & INTRODUCTION GOLANG
1. Install GoLang di https://golang.org/dl/
2. Setting Path Untuk Project Golang
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
3. Hello world di golang
4. Explore basicnya disini : https://tour.golang.org/welcome/1