Skip to content

Instantly share code, notes, and snippets.

View orzklv's full-sized avatar
🏴
For me, open source is a moral thing.

Orzklv orzklv

🏴
For me, open source is a moral thing.
View GitHub Profile
@orzklv
orzklv / good-example.hs
Created March 28, 2025 18:10
Java devs, get the rope!
-- Algebraic data type definition
data Tree a = Empty | Node (Tree a) a (Tree a) deriving (Show)
-- Insertion function
insert :: (Ord a) => a -> Tree a -> Tree a
insert x Empty = Node Empty x Empty
insert x (Node left v right)
| x < v = Node (insert x left) v right
| otherwise = Node left v (insert x right)
{
lib,
stdenv,
jre8,
curl,
ccid,
fetchurl,
pcsclite,
pcsc-tools,
writeShellScript,
❯ export NIXPKGS_ALLOW_BROKEN=1 && nix build .#nixosConfigurations.Installer.config.system.build.isoImage --show-trace
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:34:12:
33|
34| strict = derivationStrict drvAttrs;
| ^
35|
… while evaluating derivation 'nixos-24.11.20241205.4dc2fc4-x86_64-linux.iso'
{
homeConfigurations = {
# ___ __
# / | ____ ____ / /__
# / /| | / __ \/ __ \/ / _ \
# / ___ |/ /_/ / /_/ / / __/
# /_/ |_/ .___/ .___/_/\___/
# /_/ /_/
# For all my current OSX machines
"sakhib@apple" = home-manager.lib.homeManagerConfiguration {
@orzklv
orzklv / before-flake.nix
Created August 15, 2024 15:56
My life before flake-utils.lib.eachDefaultSystem was:
...
let
lib = nixpkgs.lib;
systems = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
@orzklv
orzklv / readme.md
Last active February 25, 2025 07:25
How to migrate from homebrew to Nix package manager by Orzklv!

How to migrate from Homebrew to Nix

#homebrew #brew #nix #nixos

I'll be honest with ya'll, you don't wanna get away from Homebrew completely, yes, I'll explain!

I've been using Nix package manager in all my MacOS machines about 3-4 months and I always kept Homebrew installed. You see, Nix is a very good package manager and with its home-manager, it becomes a good config farm as well. However, installing & managing GUI & unfree apps via Nix has been a quite painful experience for me. Sometimes, it wouldn't run properly, crash or wouldn't even start. Also, Nix doesn't have most of GUI packages that Homebrew has. Therefore, I keep homebrew and use it only for its "casks" registry to install GUI & unfree apps whereas having nix to manage dot file configurations and cli apps.

@orzklv
orzklv / linkedshit.rs
Created March 14, 2024 14:37
Linked List implementation on Rust
use std::mem;
pub struct List<T> {
head: Link<T>,
}
type Link<T> = Option<Box<Node<T>>>;
struct Node<T> {
elem: T,
@orzklv
orzklv / readme.md
Last active March 6, 2024 16:26
How can we all profit from this chat

image

This message was sent in a private chat consisting communities leaders listed here

I agree with his point, honestly :D

He literally spoke out the current state of this chat. Yes, we might come up with ideas and try to (sorta) exchange with experiences. In the end, it’s just only a few communities that are profiting from this chat.

We all came here, because ALL of US wanted something or somehow profit from being together for the sake of our own communities.

@orzklv
orzklv / lazy-git.sh
Created February 21, 2024 17:22
Lazy git for faster shit commiting
lazygit() {
USAGE="
lazygit [OPTION]... <msg>
GIT but lazy
Options:
--fixup <commit> runs 'git commit --fixup <commit> [...]'
--amend runs 'git commit --amend --no-edit [...]'
-f, --force runs 'git push --force-with-lease [...]'
@orzklv
orzklv / git-log.sh
Created February 21, 2024 17:22
Prettier way of showing git log
glog() {
setterm -linewrap off 2> /dev/null
git --no-pager log --all --color=always --graph --abbrev-commit --decorate --date-order \
--format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' "$@" \
| sed -E \
-e 's/\|(\x1b\[[0-9;]*m)+\\(\x1b\[[0-9;]*m)+ /├\1─╮\2/' \
-e 's/(\x1b\[[0-9;]+m)\|\x1b\[m\1\/\x1b\[m /\1├─╯\x1b\[m/' \
-e 's/\|(\x1b\[[0-9;]*m)+\\(\x1b\[[0-9;]*m)+/├\1╮\2/' \
-e 's/(\x1b\[[0-9;]+m)\|\x1b\[m\1\/\x1b\[m/\1├╯\x1b\[m/' \