Skip to content

Instantly share code, notes, and snippets.

Avatar

Kiswono Prayogo kokizzu

View GitHub Profile
@kokizzu
kokizzu / LICENSE
Created Apr 15, 2021 — forked from wlib/LICENSE
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
View LICENSE
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
View search-systems.md
@kokizzu
kokizzu / a-warning.md
Created Apr 10, 2021 — forked from spion/a-warning.md
C++ versus V8 versus luajit versus C benchmark - (hash) tables
View a-warning.md

Warning

This benchmark has been misleading for a while. It was originally made to demonstrate how JIT compilers can do all sorts of crazy stuff to your code - especially LuaJIT - and was meant to be a starting point of discussion about what exactly LuaJIT does and how.

As a result, its not indicative of what its performance may be on more realistic data. Differences can be expected because

  1. the text will not consist of hard-coded constants
@kokizzu
kokizzu / latency.txt
Created Apr 3, 2021 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
View clickhouse-get-tables-size.sql
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@kokizzu
kokizzu / main.go
Created Mar 18, 2021 — forked from qdm12/main.go
DNS over HTTPS server resolver under 300 lines of clean Go code
View main.go
package main
import (
"bytes"
"context"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
@kokizzu
kokizzu / upload.go
Last active Jan 22, 2021
File upload using pako.js deflate and golang, credits: gitlab.com/birowo/latihan
View upload.go
package main
import (
"fmt"
"io"
"net/http"
"os"
"github.com/rs/xid"
)
View wsl2-ubuntu
# network/dns not working?
# do not compress %TEMP%
# snap not working?
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
View jwt_golang_example.go
package main
import (
"io/ioutil"
"log"
"strings"
"net/http"
"encoding/json"
"fmt"
"time"
@kokizzu
kokizzu / note.txt
Created May 17, 2020
YHWH <> AllahSWT
View note.txt
Daripada debat, disimpulkan saja, AllahSWT tidak sama dengan YHWH, YHWH bukanlah Allah SWT
Membandingkan tuhan masing-masing agama Abrahamaic (karena kekristenan menurut Mat5:17 dan islam (ayat?) mengaku menyempurnakan agama sebelumnya), barangkali ada yang mau menyanggah
Tuhan Yahudi itu YHWH, kitab-nya Tanakh (atau kalau di Alkitab, perjanjian lama)
Tuhan Kristen itu Yesus, yaitu penggenapan nubuat2/ramalan bahwa YHWH sendiri akan menjadi manusia untuk menyelamatkan semua yang percaya
Tuhan Islam itu Allah SWT, kitabnya Quran, yang ini lain sendiri karena katanya ayatnya disampaikan jibril secara langsung kepada nabi M