Skip to content

Instantly share code, notes, and snippets.

View marcelarie's full-sized avatar
🐢
always learning

Marcel Arie marcelarie

🐢
always learning
View GitHub Profile
local function inside_tmux_session()
if vim.fn.exists "$TMUX" == 0 then
vim.api.nvim_err_writeln "Not inside tmux"
return false
end
return true
end
local line = 1

Install GitHub CLI on Arch, log in, fork kickstart.nvim, and clone it to your Neovim config

1) Install gh (GitHub CLI)

sudo pacman -S github-cli

(Optional prerequisites)

#!/usr/bin/env bash
set -euo pipefail
if [[ $# -lt 2 ]]; then
echo "Usage: grsl <file> <start_line> [end_line]"
echo ""
echo "Restore specific lines from git diff for a file"
echo ""
echo "Arguments:"
echo " file - Path to the file to restore"
@marcelarie
marcelarie / nix-templates.sh
Created July 5, 2025 20:12
Start nix dev shells without local flake.nix
#!/usr/bin/env bash
set -euo pipefail
REPO="${DEV_TEMPLATES:-$HOME/clones/own/dev-templates}"
edit=false
remote=""
lang=""
while [[ $# -gt 0 ]]; do
#!/usr/bin/env python3
import argparse
import requests
from datetime import datetime
from calendar import monthrange
BAMBOOHR_URL = "https://worldsensing.bamboohr.com/timesheet/hour/entries"
EMPLOYEE_ID = '<ID>'
PROJECT_ID = 6
@marcelarie
marcelarie / index.ts
Last active November 19, 2024 11:03
Fastify typescript boilerplatte
import Fastify from "fastify";
const fastify = Fastify({ logger: true });
fastify.get("/", async (_request, _reply) => {
return "Hello World";
});
const start = async () => {
try {
@marcelarie
marcelarie / show_webcam.sh
Created November 13, 2024 11:01
Show webcam (Wayland)
#!/usr/bin/env bash
default_webcam=$(ls /dev/video* | head -n 1)
if [ -z "$1" ]; then
webcam_number=$default_webcam
else
webcam_number="/dev/video$1"
fi
@marcelarie
marcelarie / tofi-calculator.sh
Created October 28, 2024 20:01
Minimal tofi calculator
#!/usr/bin/env bash
XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
tmp_dir="$XDG_CACHE_HOME/tofi-calc"
tmp_path="$tmp_dir/history"
is_history_value=false
max_age_days=10
mkdir -p "$tmp_dir"
if [ ! -f "$tmp_path" ]; then
@marcelarie
marcelarie / cmp-source-creation.lua
Created December 19, 2021 14:47
cmp source creation
local source = {}
---Source constructor.
source.new = function()
local self = setmetatable({}, { __index = source })
self.your_awesome_variable = 1
return self
end
---Return the source name for some information.