Skip to content

Instantly share code, notes, and snippets.

View aifrak's full-sized avatar

Franklin Rakotomalala aifrak

  • CLARK
  • Frankfurt, Germany
  • LinkedIn in/aifrak
View GitHub Profile
@aifrak
aifrak / setup-wsl2-ubuntu-rancher-desktop.md
Last active August 2, 2025 19:08
Setup scoop + WSL2 + Ubuntu + Rancher Desktop + VSCode

Setup scoop + WSL2 + Ubuntu + Rancher Desktop + VSCode

Setup

  1. In Powershell, install scoop:
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Needed to run a remote script the first time
    irm get.scoop.sh | iex
  2. In Powershell, install WSL2:
@aifrak
aifrak / calc_average_exec_time.exs
Last active July 20, 2022 13:11
Calculate average execution time inside IEX without third-part libraries
repeat = 10
microseconds = 1_000_000
max_concurrency = System.schedulers_online()
test_func = fn -> :timer.tc(PerfectNumbers, :aliquot_sum, [33_550_335]) |> elem(0) end
recompile && Stream.repeatedly(fn -> test_func end) |> Task.async_stream(fn fun -> fun.() end, timeout: :infinity, ordered: false, max_concurrency: max_concurrency) |> Stream.map(fn {:ok, r} -> r end) |> Enum.take(repeat) |> then(&(Enum.sum(&1) / repeat) / microseconds)
@aifrak
aifrak / Dockerfile.oh-my-zsh
Last active April 23, 2021 09:45
Snippet for oh-my-zsh, LSD Deluxe and FZF inside Docker for dev environment
# oh-my-zsh + nerd font + fira code + LSD Deluxe
FROM aifrak/oh-my-zsh:0.3.2 AS oh-my-zsh
FROM build AS build-dev
ARG APP_USER_ZSH=$APP_USER_HOME/.oh-my-zsh
ARG APP_USER_ZSH_CUSTOM=$APP_USER_ZSH/custom
# zsh
COPY --from=oh-my-zsh /bin/rzsh /bin/zsh /bin/zsh5 /bin/
COPY --from=oh-my-zsh /usr/bin/zsh /usr/bin/zsh
@aifrak
aifrak / install-vscode-extensions.sh
Last active October 4, 2025 15:20
Install VSCode extensions
#!/bin/sh
# ------------------- General ------------------ #
# Settings
code --install-extension editorconfig.editorconfig
code --install-extension PeterSchmalfeldt.explorer-exclude
# AI Code Assistants
code --install-extension Continue.continue
@aifrak
aifrak / Free Code Camp - Portofolio.markdown
Last active July 3, 2016 12:10
Free Code Camp - Portofolio