Skip to content

Instantly share code, notes, and snippets.

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

Sokhibjon Orzikulov orzklv

🏴
For me, open source is a moral thing.
View GitHub Profile
@orzklv
orzklv / readme.md
Last active May 30, 2024 18:50
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/' \
@orzklv
orzklv / crash.log
Created February 10, 2024 22:43
Telegram crash log
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Telegram [17224]
Path: /Applications/Telegram.app/Contents/MacOS/Telegram
Identifier: ru.keepcoder.Telegram
Version: 10.7.1 (259074)
App Item ID: 747648890
App External ID: 863422799
@orzklv
orzklv / default.nix
Created January 28, 2024 09:35
NIx Flake Example
{ lib
, llvmPackages
, cmake }:
llvmPackages.stdenv.mkDerivation rec {
pname = "rust";
version = "0.1.0";
src = ./.;
@orzklv
orzklv / java.reg
Last active July 6, 2023 07:39
Add OpenJDK 18 to registrars on Windows 11. This action is not being automatically done on default if you install Java with scoop.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft\Java Runtime Environment]
"CurrentVersion"="18.0.1"
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft\Java Runtime Environment\18.0]
"JavaHome"="C:\\Users\\Sakhib\\Scoop\\apps\\openjdk\\current"
"MicroVersion"="0"
@orzklv
orzklv / google.sh
Created May 31, 2023 15:18
Googling from shell script
google() {
if [ -z "$1" ]; then
echo "No argument supplied"
return
fi
echo "Searching for $@"
search_string="$@"
# Linux users should change "open" to "xdg-open"
# or create alias open="xdg-open"
open "https://www.google.com/search?q=$search_string"
@orzklv
orzklv / paru.sh
Created May 31, 2023 15:18
Install paru AUR manager on Arch Linux
# We need to install rust
sudo pacman -S rustup, base-devel
# Install rust components
rustup # accept all defaults
# Let's clone the source code first
git clone https://aur.archlinux.org/paru.git
# Go to folder and install it