<commit_before>﻿# ================= Enviroment Variables =================


# ================= Modules =================
# oh-my-posh & posh git 
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Agnoster

# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
  Import-Module "$ChocolateyProfile"
}

# fzf
Remove-PSReadlineKeyHandler 'CTRL+R'
Import-Module PSFzf

# ================= Terminal Options =================
Set-PSReadlineOption -BellStyle None # Disable bell

# ================= Aliases =================
# Chrome
Set-Alias chrome "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

# Git (partially from oh-my-zsh)
function glol {git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit $args}
function glola {git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all $args}
function gst {git status $args}
function gss {git status -s $args}
function gcv {git commit -v $args}
function gco {git checkout $args}
function gcd {git checkout develop $args}
function glg {git log --stat --graph $args}
function gd  {git diff $args}
function gaa {git add --all $args}

# ================= Video-Download Functions =================
# Preset for youtube-dl for ffmpeg and fast download
function Video-Download
{
    $output = '"' + $(Get-ScriptDirectory) + '\%(title)s.%(ext)s"'
    youtube-dl --format "best" --prefer-ffmpeg "ffmpeg" --external-downloader "aria2" -o $output $args
}

# Gets the directory from where a script is located
# Commands using script will default have PWD %windows%\system32
function Get-ScriptDirectory
{
    $Invocation = (Get-Variable MyInvocation -Scope 1).Value;
    if($Invocation.PSScriptRoot)
    {
        $Invocation.PSScriptRoot;
    }
    Elseif($Invocation.MyCommand.Path)
    {
        Split-Path $Invocation.MyCommand.Path
    }
    else
    {
        $Invocation.InvocationName.Substring(0,$Invocation.InvocationName.LastIndexOf("\"));
    }
}<commit_msg>Added threading to Video-Download<commit_after>﻿# ================= Enviroment Variables =================


# ================= Modules =================
# oh-my-posh & posh git 
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Agnoster

# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
  Import-Module "$ChocolateyProfile"
}

# fzf
Remove-PSReadlineKeyHandler 'CTRL+R'
Import-Module PSFzf

# ================= Terminal Options =================
Set-PSReadlineOption -BellStyle None # Disable bell

# ================= Aliases =================
# Chrome
Set-Alias chrome "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

# Git (partially from oh-my-zsh)
function glol {git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit $args}
function glola {git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all $args}
function gst {git status $args}
function gss {git status -s $args}
function gcv {git commit -v $args}
function gco {git checkout $args}
function gcd {git checkout develop $args}
function glg {git log --stat --graph $args}
function gd  {git diff $args}
function gaa {git add --all $args}

# ================= Video-Download Functions =================
# Preset for youtube-dl for ffmpeg and fast download
function Video-Download
{
    $downloader = '--external-downloader "C:\aria2\aria2c.exe"'
    $output = '"' + $(Get-ScriptDirectory) + '\%(title)s.%(ext)s"'
    $scargs = "$output $args"
    $runCmd = 'youtube-dl --format "best" --prefer-ffmpeg --ffmpeg-location "C:\ffmpeg-win64-static\bin" --external-downloader "C:\aria2\aria2c.exe" -o ' + $scargs

    echo $runCmd

    Start-Job { Invoke-Expression $args[0] } -ArgumentList $runCmd
}

# Gets the directory from where a script is located
# Commands using script will default have PWD %windows%\system32
function Get-ScriptDirectory
{
    $Invocation = (Get-Variable MyInvocation -Scope 1).Value;
    if($Invocation.PSScriptRoot)
    {
        $Invocation.PSScriptRoot;
    }
    Elseif($Invocation.MyCommand.Path)
    {
        Split-Path $Invocation.MyCommand.Path
    }
    else
    {
        $Invocation.InvocationName.Substring(0,$Invocation.InvocationName.LastIndexOf("\"));
    }
}
{'fraction_non_alphanumeric': 0.20310790107244472, 'fraction_numerical': 0.004815057999562267, 'mean_word_length': 4.499398315282792, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '818242', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1485, 'n_words': 363}