Skip to content

Instantly share code, notes, and snippets.

View MaraScott's full-sized avatar
🇪🇺
Maras IT

MaraScott MaraScott

🇪🇺
Maras IT
View GitHub Profile
param(
[string]$DirectoryPath = ".",
[string]$CsvFilePath = ".\directory_list.csv"
)
# Function to check if a directory is already listed in the CSV
function Read-DirectoryRow {
param(
$DataTable,
[string]$DirectoryName
from bs4 import BeautifulSoup
import pandas as pd
# Step 1: Parse the favorites_5_16_24.html file
with open('favorites_5_16_24.html', 'r', encoding='utf-8') as file:
soup = BeautifulSoup(file, 'html.parser')
# Extract all links
links = soup.find_all('a')
bookmarks = [{'name': link.get_text(), 'url': link['href']} for link in links]
@MaraScott
MaraScott / run_nvidia_gpu_jurigged.bat
Last active June 1, 2024 08:16
run_nvidia_gpu_jurigged.bat
# .\python_embeded\python.exe .\python_embeded\Scripts\pip.exe install jurigged
.\python_embeded\python.exe -m jurigged --watch ComfyUI/custom_nodes/ComfyUI_MaraScott_nodes/ -v ComfyUI/main.py --listen local.marascott.ai --port 8188
Get-ChildItem -Path "C:\Path\To\Dir" -Recurse | Select @{Name="MB Size";Expression={ "{0:N1}" -f ($_.Length / 1MB) }}, Fullname, LastWriteTime | Export-CSV -Path "C:\Path\To\Dir\list.csv" -NoTypeInformation
@MaraScott
MaraScott / php-class-abstract_interface_trait_final.php
Created June 28, 2021 06:37
Php abstract class, interface, trait, final
<?php
echo "ABSTRACT : DECLARE CLASS THE WAY YOU WANT", "\n\n";
abstract class AbstractClass
{
// Our abstract method only needs to define the required parameters
abstract protected function prefixName($name);
}
class ConcreteClass extends AbstractClass
git config core.sparsecheckout true
nano .git/info/sparse-checkout
# .git/info/sparse-checkout
/*
!/wp-content/uploads/20*
@MaraScott
MaraScott / git-replay-all-comit-to-remote.sh
Created January 21, 2020 14:14
re-execute all commit line per line from beginning to push on a remote repo
git rev-list --reverse master | ruby -ne 'i ||= 0; i += 1; puts $_ if i % 1 == 0' | xargs -I{} git push other_remote +{}:refs/heads/other_branch
@MaraScott
MaraScott / gitpushbatch.sh
Created December 10, 2019 21:49 — forked from alexxxdev/gist:1dd024cadea091ca64154f9616d5739a
remote: fatal: pack exceeds maximum allowed size
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else
@MaraScott
MaraScott / README.md
Created October 30, 2018 12:07 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
  • List every object at each commit.
@MaraScott
MaraScott / redirect_non_ssl_to_ssl.conf
Last active October 30, 2020 12:00
Redirect non ssl to ssl
RewriteEngine On
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^.*$ https://www.domain.tld%{REQUEST_URI} [R,L]