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 / Free Code Camp - Portofolio.markdown
Last active July 3, 2016 12:10
Free Code Camp - Portofolio
@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 / 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 / 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 / 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 / matrix_manipulation_in_elixir.livemd
Created August 20, 2022 11:46
Matrix manipulation in Elixir

Matrix manipulation in Elixir

Initialize matrix

matrix = [
  [1, 2, 3, 4, 5],
  [16, 17, 18, 19, 6],
  [15, 24, 25, 20, 7],
  [14, 23, 22, 21, 8],
@aifrak
aifrak / connect_contained_livebook_to_contained_node.md
Last active September 30, 2025 20:39
Attach a contained Livebook to a contained Elixir node

Attach a contained Livebook to a contained Elixir node

1 - Run Livebook container

  1. "Check that the version of Elixir on the client matches the server" (Source)
  2. In livebook container, publish ports. For example:
    8080:8080
    8081:8081
  3. Add network of the elixir container to the livebook container. To list networks, run docker network ls.
  4. Bind your own folder to /data from the Livebook container.
@aifrak
aifrak / launch.json
Last active January 2, 2023 18:19
Running tests in VSCode with Elixir and ElixirLS
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "mix_task",
"name": "mix test",
"request": "launch",
@aifrak
aifrak / syntax-highlighting-for-regex-vscode.md
Last active June 23, 2023 14:33
Sync highlighting for RegEx in VSCode

Syntax highlighting for RegEx in VSCode

VSCode allows us to customize a theme with the setting editor.tokenColorCustomizations. Some theme like Dark Modern VSCode theme or Github Dark Default have already syntax highlighting for RegEx.

Knowing that, we have the possibilities to have a more advanced highlighting closer to regex101, regexr or regextester.

@aifrak
aifrak / Microsoft.PowerShell_profile.ps1
Created November 22, 2023 21:39
Alias for powershell
# Copy this file in C:\Users\[USER]\Documents\WindowsPowerShell
# Default theme
# oh-my-posh init pwsh | Invoke-Expression
# Use another theme from home folder
# oh-my-posh init pwsh --config ~\thema-test.omp.yml | Invoke-Expression
# Use another theme from scoop folder
# oh-my-posh init pwsh --config C:\Users\[USER]\scoop\apps\oh-my-posh\current\themes\hunk.omp.json | Invoke-Expression