Skip to content

A diverse collection of scripts, snippets, and functions

License

Notifications You must be signed in to change notification settings

voytas75/VoytasCodeLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Welcome to VoytasCodeLab

ko-fi

Explore a diverse collection of my scripts, snippets, and functions across multiple programming languages. Whether you're working with PowerShell, Python, Bash, JavaScript, or more, VoytasCodeLab provides a valuable resource for automation, development, and learning. Dive into various coding examples and enhance your programming toolkit with Voytas.

The Code

  1. Google Knowledge Graph Search Tool

    [Python] [CrewAI] [Google Knowledge Graph API]

    The google_KGS_tool.py script is designed to perform searches using the Google Knowledge Graph Search API.

    Key Features:

    • Search Query: Specify a literal string to search for in the Knowledge Graph.
    • Result Limit: Limits the number of entities to be returned. Maximum is 500. Default is 10.
    • Language Support: Specify the list of language codes to run the query with.
    • Type Restriction: Restricts returned entities to those of the specified types.
    • Prefix Match: Enables prefix (initial substring) match against names and aliases of entities.
  2. CrewAI Tech Discussion Assistant

    [Python] [CrewAI] [Azure OpenAI]

    The crewai-PROD-TechDiscussionAssistant.py script is designed to run CrewAI for technical discussions and assistance. This script allows users to specify a topic for discussion and provides various modes such as planning and manager modes. It utilizes configurations and tools from the CrewAI framework to facilitate discussions and generate professional reports.

    Key Features:

    • Topic Discussion: Specify a topic for in-depth technical discussion.
    • Multiple Modes: Enable planning and manager modes for hierarchical or sequential processing.
    • Verbose Output: Option to enable detailed output for better insights.
    • Result Count: Specify the number of web results to retrieve.
    • Caching and Memory Options: Enable or disable caching and memory for the crew.
    • Agent-Based Tasks: Utilizes specialized agents for tasks such as web search, data verification, relevance analysis, and report writing.
    • Markdown Reports: Generates structured markdown-formatted reports with detailed sections including responses, findings, recommendations, and timelines.

    Example Usage:

    python crewai-PROD-TechDiscussionAssistant.py --topic "What's new in Windows Server" --result_count 5

    Source Code: crewai-PROD-TechDiscussionAssistant.py

  3. CrewAI News Analyzer

    [Python] [CrewAI] [Azure OpenaAI]

    The crewai-PROD-News_analyzer_A2_v2.py script is designed to run CrewAI for comprehensive news search and analysis. This script allows users to specify a topic for analysis and provides various modes such as planning and manager modes. It utilizes configurations and tools from the CrewAI framework to perform detailed analysis and generate professional reports.

    Key Features:

    • Topic Analysis: Specify a topic for in-depth news analysis.
    • Multiple Modes: Enable planning and manager modes for hierarchical or sequential processing.
    • Verbose Output: Option to enable detailed output for better insights.
    • Result Count: Specify the number of web results per provider to retrieve.
    • Caching and Memory Options: Enable or disable caching and memory for the crew.
    • Agent-Based Tasks: Utilizes specialized agents for tasks such as web search, data verification, trend analysis, and report writing.
    • Markdown Reports: Generates structured markdown-formatted reports with detailed sections including trends, findings, recommendations, and timelines.

    Example Usage:

    python crewai-PROD-News_analyzer_A2_v2.py --topic "What's new in Windows Server" --planning --verbose --result_count 5

    Source Code: crewai-PROD-News_analyzer_A2_v2.py

  4. Get-CyclomaticComplexity

    [PowerShell]

    Calculates the cyclomatic complexity of a PowerShell script or code block, including both functions and top-level code.

    PowerShell Gallery

    Published version: Powershell gallery

    Source code

    Example

    $code = @"
        if ($true) { Write-Output "True" }
        else { Write-Output "False" }
        function Test {
            if ($true) { Write-Output "True" }
            else { Write-Output "False" }
        }
        "@
    Get-CyclomaticComplexity -CodeBlock $code
    Get-CyclomaticComplexity -CodeBlock (Get-Content "D:\path\to\file.ps1" -raw)
    Get-CyclomaticComplexity -FilePath "C:\path\to\file.ps1"
  5. Random numbers

    [PowerShell]

    A script to generate a series of random numbers using different methods and formats.

    The script uses both built-in PowerShell capabilities and .NET classes to generate random numbers. It showcases different ways to generate random numbers as UInt64 and UInt32, both as a full range and a fractional number between 0 and 1.

    If you need random numbers for cryptographic purposes, it's recommended to use classes from "System.Security.Cryptography", such as "RandomNumberGenerator", which provides cryptographic strength random number generation.

    Linkedin

    random.ps1

  6. Convert-YouTubeTranscript

    [PowerShell]

    Converts a YouTube transcript into a structured format with timestamps and corresponding text.

    This script takes a YouTube transcript (glasp.co - transcript extension) as input and extracts the timestamps and their corresponding text. It returns an array of custom objects, each containing a timestamp and the associated text.

    Example

    $transcript = @"
    (00:00) on September 1st last year a team of 16 scientists made a stunning discovery that sent shock waves through the scientific Community they ...
    (05:52) essentially cease to exist for them they are momentary in a sense passing through the fabric of SpaceTime without experiencing the passage ...
    (10:09) unfolding this concept becomes even more exciting when applied to photons or particles of light photons have no clear past present or future ...
    (12:24) basic assumptions of The Big Bang Theory
    "@
    
    $results = Convert-YouTubeTranscript -transcript $transcript
    $results | Format-Table -AutoSize

    Source code

    transcript extension

  7. Get-ADUserACLsAndExtendedRights

    [PowerShell]

    Retrieves the Access Control List (ACL) and Extended Rights for a specified Active Directory user.

    This script fetches the ACL for a user object in Active Directory and maps any Extended Rights GUIDs to their corresponding names. It outputs the ACL entries in a formatted table.

    Example

    IdentityReference                            ActiveDirectoryRight       ExtendedRightName     ExtendedRightGUID
    -----------------                            --------------------       -----------------     -----------------
    XYZ\TASK-T2-User-ResetPassword                      ExtendedRight          Reset Password     00299570-246d-11d0-a768-00aa006e0529
    XYZ\TASK-T2-User-Move                               ExtendedRight          Reset Password     00299570-246d-11d0-a768-00aa006e0529
    XYZ\TASK-T2-User-DisableEnable                      WriteProperty          N/A                N/A                                 
    XYZ\TASK-T2-User-MemberOf                           WriteProperty          N/A                N/A                                 
    XYZ\TASK-T2-User-ResetPassword        ReadProperty, WriteProperty          N/A                N/A                                 
    XYZ\TASK-T2-User-Move                    CreateChild, DeleteChild          N/A                N/A                                 
    XYZ\TASK-T2-User-Move                               WriteProperty          N/A                N/A                                 
    

    Source code $CURSOR$

  8. Five heuristics for when git worktree is worth it (and when it’s not)

    1. You have more than one task in parallel (feature + hotfix + experiment) → worth it. If you always do one small task end-to-end → probably not.
    2. You often get blocked by “cannot switch branch, dirty working tree” → worth it.
      If you rarely use stash and switching branches is painless → less needed.
    3. Builds/dependencies are heavy or conflict (node_modules, venv, build cache) → worth it, because each folder has its own state.
      If the repo is lightweight → smaller gain.
    4. You want ultra-clean PRs/commits (no “while I’m here” changes) → worth it.
      If you work without PR/review and you don’t care much → optional.
    5. You return to tasks after days/weeks → worth it, because the folder itself preserves context.
      If you usually finish things the same day → optional.

    Rule of thumb: worktrees shine the moment you think “I’ll pause this and do something else” — instead of stashing, you spin up another folder.

About

A diverse collection of scripts, snippets, and functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published