Skip to content

Instantly share code, notes, and snippets.

View KennFatt's full-sized avatar
🌠
Stargazing

Kennan Fattahillah KennFatt

🌠
Stargazing
View GitHub Profile
@KennFatt
KennFatt / dev-jest-coverage.sh
Last active May 16, 2025 14:27
React Testing Library (RTL) and Jest - Run all tests from one file and show the coverage in browser
local jest_bin=./node_modules/jest/bin/jest.js
local node_bin=node
if [[ -f $jest_bin ]]; then
# node node_modules/jest/bin/jest.js Counter.test.tsx --coverage --reporters=jest-junit --watchAll=false --coverageDirectory=reportcoverage -c ./jest.config.ts -t 'Counter'
function dev-jest-coverage() {
if [[ -z $1 ]]; then
echo "Usage: $0 <file_name: string|regex> <test_name: string|regex>"
echo "Example: $0 Counter.test.tsx 'Counter component'"
return
@KennFatt
KennFatt / launch.json
Created September 10, 2024 11:13
Visual Studio code debugger launch options to run a specific main file from project's workdir (usually for my HTTP services).
{
"configurations": [
{
"cwd": "${workspaceFolder}",
"mode": "debug",
"name": "Launch file",
"program": "${workspaceFolder}/cmd/main.go",
"request": "launch",
"type": "go"
}
@KennFatt
KennFatt / go-gen-cover.sh
Created November 24, 2023 12:45
A bash function to run golang test coverage for specific module in your project and open the report in your web browser.
function go-gen-cover() {
# Check dependencies
if ! type xargs &>/dev/null; then
echo "error: 'xargs' command is missing"
return 1
fi
if ! type go &>/dev/null; then
echo "error: 'go' command is missing"
return 1
@KennFatt
KennFatt / kbd67mkiirgbv3.json
Created September 29, 2022 17:25
My KBD67 Lite R4 keymap (VIA config)
{
"name": "KBD67MKIIRGBV3",
"vendorProductId": 1262621222,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_ESC",
"KC_1",
"KC_2",
"KC_3",
@KennFatt
KennFatt / iss_recap.md
Last active May 17, 2021 07:36
🔐 Recap: Information System Security Module

🔐 Recap: Information System Security Module

Pertanyaan meliputi materi yang telah dipelajari dari module ISS Bab 1 dan 2.

⚠️ Disclaimer

Pertanyaan dan informasi yang saya sampaikan hanya berdasarkan module dan beberapa elaborasi pribadi. Untuk memastikan kebenaran mohon baca module dan re-search kembali. Original content: KennFatt's Gist

@KennFatt
KennFatt / execution_sequence.js
Last active April 23, 2021 06:42
In-depth JS Runtime Environment: Microtask vs. Task
console.log("Starting the program...");
setTimeout(() => {
console.log("Task#1");
setTimeout(() => console.log("task#2"));
});
queueMicrotask(() => {
console.log("microtask#1");
@KennFatt
KennFatt / .prettierrc
Created September 13, 2020 16:52
My personal prettier rc file.
{
"semi": false,
"jsxBracketSameLine": true,
"proseWrap": "never",
"embeddedLanguageFormatting": "off"
}
@KennFatt
KennFatt / parser.py
Created September 8, 2020 23:04
Find all icon directories for option that Dunst notification needs.
from pathlib import Path
import os
import configparser
import sys
import traceback
HOME = Path().home()
ICONS_PATH = [
import notify2
import requests
import pathlib
import os
APP_NAME = "notifier"
IMG_NAME = "_notifier"
TMP_DIR = pathlib.Path(f"/tmp/{IMG_NAME}")
@KennFatt
KennFatt / .zshrc
Created August 25, 2020 08:45
Zshrc file
# Lines configured by zsh-newuser-install
HISTFILE=/media/seagate/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt extendedglob
unsetopt notify
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
# NOTE|IMPORTANT: Use abspath to the .zshrc file (e.g. /home/Users/.zshrc)