Skip to content

Instantly share code, notes, and snippets.

View acfatah's full-sized avatar
🎯
Focusing

Achmad F. Ibrahim acfatah

🎯
Focusing
View GitHub Profile
@acfatah
acfatah / mongodb_6_on_wsl2_ubuntu_2204.md
Created September 4, 2025 22:14 — forked from leobeeson/mongodb_6_on_wsl2_ubuntu_2204.md
Installation of MongoDB 6.0 on WSL2 Ubuntu 22.04

Installation of MongoDB 6.0 on WSL2 Ubuntu 22.04

Installed MongoDB using the following guide: Install MongoDB

However, the installation in the guide is for MongoDB 5.0 on WSL with Ubuntu 20.04 (focal) distro.

The following is an adaptation of the guide for installing MongoDB 6.0 on WSL with Ubuntu 22.04 jammy distro.

  1. Open your WSL terminal (ie. Ubuntu) and go to your home directory:: cd ~
  2. Update your Ubuntu packages: sudo apt update
@acfatah
acfatah / bun-lint-test-typecheck.yml
Created March 7, 2025 00:09 — forked from morajabi/bun-lint-test-typecheck.yml
Bun test, lint, and typecheck your Bun project in GitHub actions with caching
# .github/workflows/test.yml
on:
push:
branches:
- main
pull_request:
branches:
- main
@acfatah
acfatah / - acfatah Git Activities.md
Last active July 18, 2025 23:33
Gist Image Hosting

Git Image Hosting using Gist Comment

JavaScript Modules

  1. How do I make the tree shakeable?
  2. What JS module systems should I target (CommonJS, AMD, ES6).
  3. Should I transpile the source?
  4. Should I bundle the source?
  5. What files should I publish?

Let's try to address all the above questions now.

@acfatah
acfatah / bash_strict_mode.md
Created April 1, 2023 02:33 — forked from vncsna/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@acfatah
acfatah / sleep.js
Last active March 17, 2023 02:38
Javascript ES Module - sleep.js
/**
* Sleep, delay, pause or wait in Javascript
* @link https://www.sitepoint.com/delay-sleep-pause-wait/
* @param {Number} timeout Number in miliseconds
* @return {Promise}
*/
export const sleep = timeout => new Promise(resolve => setTimeout(resolve, timeout))
@acfatah
acfatah / component-app.js
Created February 7, 2023 08:16 — forked from kesor/component-app.js
Vue.js 3.x with ES6 modules in the browser using import-map
import { defineAsyncComponent } from 'vue'
const Content = defineAsyncComponent(() => import('./component-content.js'))
export default {
name: 'App',
components: { Content },
template: /*html*/`
<Content />
`
@acfatah
acfatah / bash_template.sh
Created February 2, 2023 02:46 — forked from rsperl/bash_template.sh
bash script templates #shell #template #snippet
#!/bin/bash
# see also
# - Google's Shell Style Guide: https://google.github.io/styleguide/shell.xml
# - ShellCheck: https://github.com/koalaman/shellcheck
# src:
# - http://hackaday.com/2017/07/21/linux-fu-better-bash-scripting
# - https://dev.to/thiht/shell-scripts-matter
@acfatah
acfatah / unix-digitalocean-spaces-s3cmd.md
Last active January 27, 2023 03:39 — forked from jbutko/unix-digitalocean-spaces-s3cmd.md
Unix (ubuntu): setup and use s3cmd to upload files to digitalocean spaces
@acfatah
acfatah / singleton_logger.rb
Created December 19, 2022 03:21 — forked from cheeyeo/singleton_logger.rb
Simple logger using Ruby's built in Singleton module
require 'singleton'
class SimpleLogger
include Singleton
attr_accessor :level
ERROR=1
WARNING=2
INFO=3