Skip to content

Instantly share code, notes, and snippets.

View aldy505's full-sized avatar
🐅

Reinaldy Rafli aldy505

🐅
View GitHub Profile
@aldy505
aldy505 / code-scan.yml
Last active April 21, 2024 02:33
Code scanning defaults for Github Actions (works on public and private repository with no limits)
# Code scanning is something you would want to do to ensure the quality of your codebase.
# Usually, it'll detects security vulnerabilities, code smells, and other issues that might be present in your code.
# To learn more about code scanning, see https://snyk.io/learn/code-review/code-scanning/
name: Code Scan
on:
# Scan changed files in PRs (diff-aware scanning):
pull_request: {}
# Scan on-demand through GitHub Actions interface:
workflow_dispatch: {}
@aldy505
aldy505 / sysctl.conf
Created September 21, 2023 15:12
Linux sysctl optimization. Taken from https://klaver.it/linux/sysctl.conf
# Kernel sysctl configuration file for Linux
#
# Version 1.14 - 2019-04-05
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@aldy505
aldy505 / docker-compose.yml
Created September 10, 2023 06:43
Multi database on runtime proof-of-concept
services:
database:
image: postgres:15-alpine
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: password

Keybase proof

I hereby claim:

  • I am aldy505 on github.
  • I am aldy505 (https://keybase.io/aldy505) on keybase.
  • I have a public key whose fingerprint is 6EBA CBDC 3463 D2C9 986A 2F21 A3F8 A7E2 3DA2 AD94

To claim this, I am signing this object:

@aldy505
aldy505 / exec.sh
Created July 10, 2022 01:31
Spin up clustered rqlite on 1 host
rqlited \
-auth rqlite.json \
-fk \
-node-id 1 \
-http-addr localhost:4001 \
-raft-addr localhost:4002 \
./node.1
rqlited \
-auth rqlite.json \
@aldy505
aldy505 / browser-ts.ts
Created May 15, 2022 07:30
Proto2http generated client & server samples for router_guide.proto
/**
* Points are represented as latitude-longitude pairs in the E7 representation
* (degrees multiplied by 10**7 and rounded to the nearest integer).
* Latitudes should be in the range +/- 90 degrees and longitude should be in
* the range +/- 180 degrees (inclusive).
*/
type Point = {
latitude: number
longitude: number
}
@aldy505
aldy505 / networking_fix_wsl2.ps1
Created December 14, 2021 04:16
Dropping in here in case there's another error on networking in my WSL2
# Shutdown WSL first
wsl --shutdown --verbose
# Check it with list
wsl --list --verbose
# Open Powershell in administrator mode, then do:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
Get-Service LxssManager | Restart-Service
@aldy505
aldy505 / benchmark_result.md
Created December 11, 2021 10:50
A benchmark between Polka (Nodejs) with Jaguar (Dart)

TLDR: Polka won.

http://localhost:5000 is Jaguar. http://localhost:4000 is Polka.

❯ hyperfine --warmup 2 --min-runs 500 \
> 'curl --request GET \
>   --url http://localhost:5000/ \
>   --header "Accept: application/json" \
>   --header "Content-Type: application/json" \
@aldy505
aldy505 / 14_days.js
Last active December 6, 2021 08:03
A port of my Go's 14 days challenge into Javascript
// Hello again. This time, we will be exploring the
// Date class and object.
//
// The function that we'll make is pretty simple,
// we are going to have a date input, in the form (or type)
// of Date, then we'll add 14 days to it.
//
// But here's the tricky part:
// We'll skip satuday and sundays, so the entire 14 days
// should be on weekdays only, not on weekends.
@aldy505
aldy505 / 14_days.go
Created December 1, 2021 04:53
Simple exercise to play around with the time standard library
package main
import (
"fmt"
"time"
)
// Hello again. This time, we will be exploring the
// time standard library.
//