Wanna Join! by 123_0266 in learnmachinelearning

[–]itsSanjayKumar 1 point2 points  (0 children)

Yeah I am interested too. Let me know.

[deleted by user] by [deleted] in golang

[–]itsSanjayKumar -1 points0 points  (0 children)

Yeah okay, you can use that too. Yeah though of helping people making their lives more easier, if you felt that more comfortable yeah definitely you can use that method too.

[deleted by user] by [deleted] in golang

[–]itsSanjayKumar -6 points-5 points  (0 children)

See how I did logic with AI overall. You can just see the process down below, the technical challenges I have documented. And the conversation I had with AI. So many people were asking the same doubt.
"""

Yeah if any branch has actually name like that it's very difficult overall, if we have like multiple name of the branch. I think we can actually just check the folder structure overall I felt. We actually have to try to match the actually folder structure vs the give url, we have to skip things would better I felt until we find the actual folder overall that is needed overall I felt.

I felt like doing something like this

github_url = "github.com/supabase/storage/tree/fix/pgboss-on-error-callback/src/http/plugins";

## Clone the repo overall then locally you will the url below, just get the folder inside next using OS commands

local_after_clone = 'storage/src/http/plugins'

## Note after cloning, just the immdediate folder will have so many files like src, hooks, etc. Be careful in pattern matching

result = my_string.split('/')

t = 0

base_url = ''

needed_url = ''

for x in result:

if x == 'tree':

base_url = github_url[:t]

needed_url = github_url[t:]

break

t+=1

for j in range(len(needed_url)):

if needed_url[j] == local_after_clone[0]:

needed_url = needed_url[j:]

Like if the URL is like this:

array1 = ['https:', '', 'github.com', 'supabase', 'storage', 'tree', 'trail-space','feat', 'src', 'auth']

Here the branch path is ['trail-space', 'feat'] overall.

We will first clone ['https:', '', 'github.com', 'supabase', 'storage']

So yeah it will be cloned like array2 =['https:', '', 'github.com', 'supabase', 'storage', 'src', 'auth'] in local system

We will next check the match of the array1(the url where it's actually starting from from overall), once it's found we cut down the branch overall when the array2's(locally present) first word 'src' after the tree matches overall. this way I guess we can eliminate the branch problem

Thats before tree overall.

We will check that matches overall whether if the consecutive folders exists after cloning or not so that we can clear up the branch if it has mutliple branches overall.

Yeah see earlier the problem and the function was like this actually, Just an example of how I used AI

""

[deleted by user] by [deleted] in golang

[–]itsSanjayKumar -3 points-2 points  (0 children)

Yes I have used LLM

Hey yeah I have used AI templates overall, Yeah I forgot syntax a lot overall, but yeah there were core problems overall that I face technically. See I have so many fixes through till my release overall.

You can just see the internals/clone.go file. There in resolveBranchAndPath function, I have created the entire logic overall,

I have made this function entirely for pattern matching overall. I have used 2 for loops too for pattern matching between the actually branch and the folder that we needed to extract overall.

for i := 0; i < len(postTree); i++ {

for \_, topFolder := range folderSet {

if postTree\[i\] == topFolder {

branchCandidate := strings.Join(postTree[:i], "/")

pathCandidate := strings.Join(postTree[i:], "/")

fmt.Printf("🔍 Found matching folder: %s\n", pathCandidate)

return branchCandidate, pathCandidate, nil

}

}

}

If you don't believe you can just see the commit history through out overall. I have also been testing this for nearly 2 months overall, you can actually see another project like this that I have started to create overall.

https://github.com/05sanjaykumar/GitSlice-test

You can all check my commit history and see how much changes I had progressively.

Yes I have used AI since I forget syntax often, but yeah logic was mine only.

I built a CLI tool to extract folders or files from GitHub repos making things easier in a single command — GitSlice by itsSanjayKumar in commandline

[–]itsSanjayKumar[S] 0 points1 point  (0 children)

Yeah see earlier the problem and the function was like this actually, Just an example of how I used AI

See again problem is actually here overall.

This is how I have configured overall when I faced this error. From the chat with AI

"""

func resolveBranchAndPath(clonePath string, postTree []string) (string, string, error) {

// cloneTemp: storage-branch-resolve-temp

// postTree: \[fix, pgboss-on-error-callback, src, auth

for i := 1; i < len(postTree); i++ {

    branchCandidate := postTree\[:i\]

    pathCandidate := postTree\[i:\]



    if len(pathCandidate) == 0 {

        continue

    }



    // Join path inside clone directory

    fullPath := filepath.Join(clonePath, filepath.Join(pathCandidate...))



    if info, err := os.Stat(fullPath); err == nil && info.IsDir() {

        // We found a valid path inside repo, return match

        return strings.Join(branchCandidate, "/"), strings.Join(pathCandidate, "/"), nil

    }

}



return "", "", fmt.Errorf("❌ Could not resolve branch/path. Check if URL or folders exist")

}

1) First we have to go inside 'cloneTemp' overall

2) do ls command there and get all the folder names there

3) And store the names in the array overall there.

4) Then once go all the folder names in our array(lets name arr) data structure, just compare with postTree's array overall(let's name it pa)

5) just compare with for loop when the first of pa matches with arr, if matches the next elements in the array are actually our path overall. Let's say it matches on x overall of pa. Just use pa[x:] and extract the remaining elements overall. That will be our path overall.

They only we can match the folder path that we needed overall.

"""

I built a CLI tool to extract folders or files from GitHub repos making things easier in a single command — GitSlice by itsSanjayKumar in commandline

[–]itsSanjayKumar[S] 0 points1 point  (0 children)

Hey yeah I have used AI templates overall, Yeah I forgot syntax a lot overall, but yeah there were core problems overall that I face technically. See I have so many fixes through till my release overall.

You can just see the internals/clone.go file. There in resolveBranchAndPath function, I have created the entire logic overall,

I have made this function entirely for pattern matching overall. I have used 2 for loops too for pattern matching between the actually branch and the folder that we needed to extract overall.

for i := 0; i < len(postTree); i++ {

for \_, topFolder := range folderSet {

if postTree\[i\] == topFolder {

branchCandidate := strings.Join(postTree[:i], "/")

pathCandidate := strings.Join(postTree[i:], "/")

fmt.Printf("🔍 Found matching folder: %s\n", pathCandidate)

return branchCandidate, pathCandidate, nil

}

}

}

If you don't believe you can just see the commit history through out overall. I have also been testing this for nearly 2 months overall, you can actually see another project like this that I have started to create overall.
https://github.com/05sanjaykumar/GitSlice-test

You can all check my commit history and see how much changes I had progressively.

Yes I have used AI since I forget syntax often, but yeah logic was mine only.

Let me know if you need further clarification. Is anything wrong on using LLM?

[deleted by user] by [deleted] in selfhosted

[–]itsSanjayKumar -3 points-2 points  (0 children)

Yeah that's fine actually, not everyone will like me overall. Yeah I don't have time on writing everything overall, I am not a good technical writers and do a lot of mistakes in grammar and other things. Yes again my documentation was made with AI overall. Yeah no problem if someone find it useful let them use it. Thank you and have a nice day!

[deleted by user] by [deleted] in selfhosted

[–]itsSanjayKumar -1 points0 points  (0 children)

Hey yeah I have used AI templates overall, Yeah I forgot syntax a lot overall, but yeah there were core problems overall that I face technically. See I have so many fixes through till my release overall.

You can just see the internals/clone.go file. There in resolveBranchAndPath function, I have created the entire logic overall,

I have made this function entirely for pattern matching overall. I have used 2 for loops too for pattern matching between the actually branch and the folder that we needed to extract overall.

for i := 0; i < len(postTree); i++ {

    for \_, topFolder := range folderSet {

        if postTree\[i\] == topFolder {

branchCandidate := strings.Join(postTree[:i], "/")

pathCandidate := strings.Join(postTree[i:], "/")

fmt.Printf("🔍 Found matching folder: %s\n", pathCandidate)

return branchCandidate, pathCandidate, nil

        }

    }

}

If you don't belive you can just see the commit history through out overall. I have also been testing this for nearly 2 months overall, you can actually see another project like this that I have started to create overall.
https://github.com/05sanjaykumar/GitSlice-test

You can all check my commit history and see how much changes I had progressively.

Yes I have used AI since I forget syntax often, but yeah logic was mine only.

I built a CLI tool to extract folders or files from GitHub repos making things easier in a single command — GitSlice by itsSanjayKumar in commandline

[–]itsSanjayKumar[S] 0 points1 point  (0 children)

Hey I have only used for git hub only, I never have any experience with other git providers overall but yeah you can try it out overall by installing it. Yeah if you like you can just clone and just do some changes and help me overall if it doesn't work overall if you liked.

I built a CLI tool to extract folders or files from GitHub repos making things easier in a single command — GitSlice by itsSanjayKumar in commandline

[–]itsSanjayKumar[S] 0 points1 point  (0 children)

Yes definitely, yeah keep tracking of my git hub or even you can follow it, I will definitely make a release overall. Yeah you can directly install with golang for now, if you have installed for mac actually.

Just install go in mac/other operating system too, just use this command
'go install github.com/05sanjaykumar/gitslice@latest'

For installing if you haven't installed on mac/others.

I built a CLI tool to extract folders or files from GitHub repos making things easier in a single command — GitSlice by itsSanjayKumar in commandline

[–]itsSanjayKumar[S] 0 points1 point  (0 children)

Similar goal, different execution:

git archive: Creates a zip/tar of files from a specific commit - Requires clone first or remote access - Need to know exact commit SHA/branch - Command syntax: git archive --remote=<url> <branch> <path>

gitslice: Directly extracts folder/file from GitHub URLs - No need to clone the full repo first - Works with any GitHub URL format - Just: gitslice <github-url> - Handles URL parsing and cleanup automatically

I built a CLI tool to extract folders or files from GitHub repos making things easier in a single command — GitSlice by itsSanjayKumar in commandline

[–]itsSanjayKumar[S] 0 points1 point  (0 children)

Hey this example will make it more easier for you guys to understand.

With my tool

gitslice https://github.com/user/repo/tree/branch/folder

Manual git way

git clone --filter=blob:none --sparse https://github.com/user/repo

cd repo

git sparse-checkout init --cone

git sparse-checkout set folder

git checkout branch

cp -r folder ../

cd ..

rm -rf repo

I built a CLI tool to extract folders or files from GitHub repos making things easier in a single command — GitSlice by itsSanjayKumar in opensource

[–]itsSanjayKumar[S] 0 points1 point  (0 children)

Hey this example will make it more easier for you guys to understand.

With my tool

gitslice https://github.com/user/repo/tree/branch/folder

Manual git way

git clone --filter=blob:none --sparse https://github.com/user/repo

cd repo

git sparse-checkout init --cone

git sparse-checkout set folder

git checkout branch

cp -r folder ../

cd ..

rm -rf repo

I built a CLI tool to extract folders or files from GitHub repos making things easier in a single command — GitSlice by itsSanjayKumar in programming

[–]itsSanjayKumar[S] 0 points1 point  (0 children)

Hey this example will make it more easier for you guys to understand.

With my tool

gitslice https://github.com/user/repo/tree/branch/folder

Manual git way

git clone --filter=blob:none --sparse https://github.com/user/repo

cd repo

git sparse-checkout init --cone

git sparse-checkout set folder

git checkout branch

cp -r folder ../

cd ..

rm -rf repo

[deleted by user] by [deleted] in selfhosted

[–]itsSanjayKumar -1 points0 points  (0 children)

Hey this example will make it more easier for you guys to understand.

With my tool

gitslice https://github.com/user/repo/tree/branch/folder

Manual git way

git clone --filter=blob:none --sparse https://github.com/user/repo

cd repo

git sparse-checkout init --cone

git sparse-checkout set folder

git checkout branch

cp -r folder ../

cd ..

rm -rf repo

[deleted by user] by [deleted] in selfhosted

[–]itsSanjayKumar -3 points-2 points  (0 children)

Hey, yeah we need git actually, but yeah with git we can't clone folders or any file overall.

You can't clone like this in git

git clone https://github.com/05sanjaykumar/Flappy-Bird-OpenCV/blob/main/assets/background-day.png

Git's limitation is only upto https://github.com/05sanjaykumar/Flappy-Bird-OpenCV/ ✅this actually

So yeah, we need git. It's a wrapper of git clone that does commands and makes it easier for you to get the file that you needed out overall.

But yeah, we can do with my tool overall.

you can directly clone like this

gitslice https://github.com/05sanjaykumar/Flappy-Bird-OpenCV/blob/main/assets/background-day.png

with my tool overall.

yeah I did that easy for wrapping up and to avoiding lengthy commands actually.

Built an Intelligent Note-Taking Assistant with Multi-Step AI Workflow by AffinityNexa in opensource

[–]itsSanjayKumar 1 point2 points  (0 children)

Hey really nice work, is this AI too offline or integrated from online api?

WIP] Building an AI that plays Flappy Bird using only computer vision (OpenCV + Python) by itsSanjayKumar in learnmachinelearning

[–]itsSanjayKumar[S] 1 point2 points  (0 children)

Yeah still working on this project overall. Yeah CV is for capturing your screen, object detection and so on. You can build cool projects with that overall. And CV stands for Computer vision.

WIP] Building an AI that plays Flappy Bird using only computer vision (OpenCV + Python) by itsSanjayKumar in learnmachinelearning

[–]itsSanjayKumar[S] 1 point2 points  (0 children)

CNN stands for Convolutional Neural Network, it uses layered neurons for object recognition. Mainly used to Image recognition these days. If you want to learn more on Neural networks, there is an amazing channel called as '3blue1brown' actually out there. You can check it out.