Skip to content

Instantly share code, notes, and snippets.

View sbatial's full-sized avatar
❄️

sbatial sbatial

❄️
View GitHub Profile
@sbatial
sbatial / bartib_starship.toml
Last active June 16, 2023 18:02
Custom starship module to show the task currently being tracked by https://github.com/nikolassv/bartib
[custom.bartib]
command = "tail -n1 $BARTIB_FILE | awk '{print \"\" $4 \" \" $2 \"\"}'"
when = 'bartib current | grep -v "No Activity is currently running"'
style = 'dimmed blue'
shell = ["sh", "-c"]
use_stdin = false
@sbatial
sbatial / bartib_select.sh
Last active June 16, 2023 13:39
Prompt to choose from recent bartib projects.
#! /usr/bin/env nix-shell
#! nix-shell --packages bartib gum bash toybox gawk -i bash
# Make sure all dependencies are present
# toybox contains tac, head, tail
# Get current status of bartib
CURRENT_PROJ=$(bartib current)
# Put selection in function to ensure shorter lines
select_task()
@sbatial
sbatial / partials.ts
Created May 24, 2023 09:53
Utility types based off of Partial
type PartialNull<T> = { [P in keyof T]: T[P] | null }
type PartialBoolean<T> = { [P in keyof T]: T[P] | boolean }
@sbatial
sbatial / flake.nix
Last active May 8, 2023 15:30 — forked from mausch/flake.nix
llama-vicuna.nix
{
description = "llama.cpp running vicuna";
inputs = {
llama.url = "github:ggerganov/llama.cpp/aaf3b23debc1fe1a06733c8c6468fb84233cc44f";
flake-utils.url = "github:numtide/flake-utils/033b9f258ca96a10e543d4442071f614dc3f8412";
nixpkgs.url = "github:NixOS/nixpkgs/d9f759f2ea8d265d974a6e1259bd510ac5844c5d";
};
outputs = { self, flake-utils, llama, nixpkgs }:
@sbatial
sbatial / uneven_sum.c
Created May 3, 2023 17:09
Summiert alle ungeraden Zahlen zwischen 1 und einem anzugebenden Wert.
int sum_unger(int startwert) {
int sum = 0;
if (startwert < 1) {
return -1;
}
startwert += (startwert % 2) - 1;
while (startwert >= 1) {
@sbatial
sbatial / push_to_origin.sh
Last active February 28, 2020 13:44
Push all branches in the current repo to Github
#!/bin/bash
while getopts r: option
do
case "${option}"
in
r) REPOSITORY=${OPTARG};;
esac
done