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 / liveview.code-snippets
Last active November 30, 2024 20:14
VSCode Phoenix LiveView snippets
{
"LiveView: ~p sigil": {
"scope": "elixir,phoenix-heex",
"body": [
"~p\"/$1\""
],
"description": "LiveView: ~p sigil",
"prefix": [
"~p"
]
@aifrak
aifrak / dark+.yaml
Created June 29, 2024 14:27
Tabby custom terminal theme (based on Dark+)
# Replace "terminal" key with the code below.
terminal:
searchOptions: {}
colorScheme:
name: Dark+
foreground: '#CCCCCC'
background: '#010409'
cursor: '#FFFFFF'
colors:
@aifrak
aifrak / oh-my-posh_custom-theme.omp.yml
Last active October 5, 2024 19:17
oh-my-posh custom theme
# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
console_title_template: "{{ .Shell }} {{if .Root}} ⚡ {{end}}{{.UserName}} \u2794 📁{{.Folder}}"
final_space: true
version: 2
palette:
aws_background: "#FFA400"
executiontime_background: "#4c1f5e"
exit_success: "#16a34a"
@aifrak
aifrak / phoenix-heex.json
Last active February 14, 2025 16:14
VSCode Phoenix HEEx snippets
{
"LiveView: Phoenix.LiveComponent call": {
"body": [
"<.live_component",
" module={$1}",
" id={$2}",
" $0",
"/>"
],
"description": "LiveView: Phoenix.LiveComponent call",
@aifrak
aifrak / elixir.json
Last active February 15, 2025 06:44
VSCode Elixir snippets
{
"Loops through recursion": {
"prefix": "rec",
"body": [
"def ${1:recursion}(${2:list}) do",
" ${1:recursion}(${2:list}, ${3:[]})",
"end",
"",
"def ${1:recursion}([${4:head} | ${5:tail}], ${6:acc}) do",
" ${0:CODE}",
@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
@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 / 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 / connect_contained_livebook_to_contained_node.md
Last active December 13, 2022 22:34
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 / 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],