Clavin June

Clavin June @clavinjune

About: a bunch of perceptrons

Location:
Jakarta, Indonesia
Joined:
Oct 5, 2018

Clavin June
articles - 78 total

Update on My Mistake on Converting Slice to Slice of Ptr in Golang

Photo by @iavnt on Unsplash Three years ago I wrote on how I wrongly implementing slice to slice...

Learn More 0 0Feb 17 '24

Golang Structured Logging Introduction

I was doing sharing session this week related to structured logging and how we can utilize it in my...

Learn More 1 0Feb 11 '24

Golang Testing HTTP Handler

FaFiFu This section is a bullshittery, you can skip it to the main section It's been...

Learn More 0 0Jan 3 '24

Fetch Current Script Tag Attributes in Javascript

Introduction Javascript is a language with thousands of users and modules. Every single...

Learn More 1 0Nov 25 '22

Learning PromQL by Exercising

learning promql by exercising

Learn More 1 0Oct 20 '22

Working with Multiple Gitconfig

Introduction This article will be a quick tips if you're using multiple git config...

Learn More 12 2Oct 8 '22

Ways to Define Custom Command-Line Flags in Golang

Introduction If you're familiar with command-line interfaces, you might have seen flags...

Learn More 0 0Sep 3 '22

Handle Database Credential Rotation in Golang

Introduction Many of you might have heard of the database credential rotation. It is a...

Learn More 14 0Aug 29 '22

Create Flag Using Bitmask and Bitwise Operator in Go

Introduction I revisit some of my college notes, and find that in my first year of...

Learn More 3 3Jul 15 '22

Find Git Branching Point Between Branch

➜ pet git:(master) git --no-pager log --oneline -1 2422e70 (HEAD -> master, origin/master)...

Learn More 4 0Jun 5 '22

Podman Support Multi Arch

$ podman machine ssh # inside podman machine $ sudo rpm-ostree install qemu-user-static $ sudo...

Learn More 0 0Jun 5 '22

Golang HTTP Handler With Gzip

Introduction Golang has many kinds of compression technique within its standard library...

Learn More 12 0May 26 '22

Golang Escape Double Quoted String Easily

main.go package main import . "fmt" func main() { Printf("%q",...

Learn More 2 0May 22 '22

Include Dotenv File to Makefile

Directory Structure $ tree -a . . ├── .env └── Makefile 0 directories, 2 files ...

Learn More 4 0May 21 '22

Golang Print Struct Verbosely

package main import ( "fmt" ) type Foo struct { bar Bar } type Bar struct { number...

Learn More 3 0May 12 '22

Golang Inject Build Time Variable

package main import . "fmt" var foo = "not injected" func main() { Println(foo) } ...

Learn More 8 0May 1 '22

Push Commit From Github Action

name: example on: push jobs: example: runs-on: ubuntu-latest steps: - uses:...

Learn More 8 0Apr 24 '22

Golang Stream All Lines From Stdin

write.sh #! /bin/sh set -euo pipefail for i in {1..100}; do echo "$i" sleep...

Learn More 5 0Apr 17 '22

Git Log Prettify

$ git log -5 \ --pretty='format:{"shortRef": "%h", "authorDateIso": "%aI", "authorName": "%aL",...

Learn More 5 0Apr 10 '22

Bash Initiate Redis Cluster Using Docker

#!/bin/sh set -e # get accessible docker bridge's IP DOCKER_BRIDGE_IP=$(docker network inspect...

Learn More 7 0Apr 3 '22

Comparing String to Avoid Time Based Attacks

Code package foo_test import ( "crypto/rand" "crypto/subtle" "fmt" ...

Learn More 5 0Mar 26 '22

Change Directory to Git Root Directory

$ pwd /tmp/bjora-project/backend/scripts/docker $ cd `git rev-parse --show-toplevel` $...

Learn More 7 0Mar 20 '22

Golang WASM Async Function

package main import ( "fmt" "syscall/js" ) type fn func(this js.Value, args []js.Value)...

Learn More 10 0Mar 13 '22

Unix Print Aliased Command's Location

$ which ls ls: aliased to ls -G $ type -a ls ls is an alias for ls -G ls is /bin/ls Enter...

Learn More 5 0Mar 5 '22

Golang HTTP Server Graceful Shutdown

package main import ( "context" "errors" "log" "net/http" "os" ...

Learn More 7 0Feb 26 '22

How to Write Portfolio for DevOps Engineer?

how to write portfolio for devops engineer

Learn More 2 0Feb 19 '22

Construct Golang Struct Using Optional Function

Using optional function to allow user optionally set attributes package main import ( ...

Learn More 4 0Feb 19 '22

Gradle Debugging Dependencies

# gradle <module-name>:dependencies --configuration <configuration> $ gradle...

Learn More 7 0Feb 12 '22

Golang Panic Handler Middleware

Handling panic elegantly: package main import ( "fmt" "log" "net/http" ) func...

Learn More 6 0Feb 5 '22

Golang Dependency Injection Using Wire

Introduction When it comes to maintaining a large application codebase, sometimes you...

Learn More 13 3Feb 2 '22