Compare commits
6 Commits
b449ded8fe
...
master
Author | SHA1 | Date | |
---|---|---|---|
5b3c01607d | |||
c11cf9202f | |||
4a7a367547 | |||
0085d4dee2 | |||
d3648342e5 | |||
642edffcfe |
@ -1,59 +1,72 @@
|
|||||||
# Get each folder in the current directory
|
# Get each folder in the current directory
|
||||||
$folders = Get-ChildItem -Directory
|
$folders = Get-ChildItem -Directory
|
||||||
|
|
||||||
|
# Array to store the folders that need to be renamed
|
||||||
|
$work = @()
|
||||||
|
|
||||||
foreach ($folder in $folders) {
|
foreach ($folder in $folders) {
|
||||||
# Get each folder in the folder
|
# Find the version number in the folder name
|
||||||
$new_folders = Get-ChildItem -Path $folder.FullName -Directory
|
$version = $folder.Name -match '(\d+\.\d+\.\d+\.\d+)'
|
||||||
foreach ($folder in $new_folders) {
|
if ($version) {
|
||||||
# Find the version number in the folder name
|
# Replace entire folder name with the version number
|
||||||
$version = $folder.Name -match '(\d+\.\d+\.\d+\.\d+)'
|
$new_name = $matches[0]
|
||||||
if ($version) {
|
|
||||||
# Replace entire folder name with the version number
|
|
||||||
$new_name = $matches[0]
|
|
||||||
|
|
||||||
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
|
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
|
||||||
$alpha = $folder.Name -match '(\d+\.\d+\.\d+\.\d+)([a-zA-Z])'
|
$alpha = $folder.Name -match '(\d+\.\d+\.\d+\.\d+)([a-zA-Z])'
|
||||||
if ($alpha) {
|
if ($alpha) {
|
||||||
$new_name = $matches[1]
|
$new_name = $matches[1]
|
||||||
$new_name = $new_name + $matches[2]
|
$new_name = $new_name + $matches[2]
|
||||||
}
|
|
||||||
|
|
||||||
#Rename-Item -Path $folder.FullName -NewName $new_name
|
|
||||||
Write-Host "Renamed $folder to $new_name"
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
# Find the version number in the folder name
|
$toadd = New-Object PSObject
|
||||||
$version = $folder.Name -match '(\d+\.\d+\.\d+)'
|
$toadd | Add-Member -MemberType NoteProperty -Name path -Value $folder.FullName
|
||||||
if ($version) {
|
$toadd | Add-Member -MemberType NoteProperty -Name newname -Value $new_name
|
||||||
# Replace entire folder name with the version number
|
$work += $toadd
|
||||||
$new_name = $matches[0]
|
|
||||||
|
|
||||||
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
|
Write-Host "Rename $folder to $new_name"
|
||||||
$alpha = $folder.Name -match '(\d+\.\d+\.\d+)([a-zA-Z])'
|
continue
|
||||||
if ($alpha) {
|
|
||||||
$new_name = $matches[1]
|
|
||||||
$new_name = $new_name + $matches[2]
|
|
||||||
}
|
|
||||||
|
|
||||||
#Rename-Item -Path $folder.FullName -NewName $new_name
|
|
||||||
Write-Host "Renamed $folder to $new_name"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
# Find the version number in the folder name
|
|
||||||
$version = $folder.Name -match '(\d+\.\d+)'
|
|
||||||
if ($version) {
|
|
||||||
# Replace entire folder name with the version number
|
|
||||||
$new_name = $matches[0]
|
|
||||||
|
|
||||||
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
|
|
||||||
$alpha = $folder.Name -match '(\d+\.\d+)([a-zA-Z])'
|
|
||||||
if ($alpha) {
|
|
||||||
$new_name = $matches[1]
|
|
||||||
$new_name = $new_name + $matches[2]
|
|
||||||
}
|
|
||||||
|
|
||||||
#Rename-Item -Path $folder.FullName -NewName $new_name
|
|
||||||
Write-Host "Renamed $folder to $new_name"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
# Find the version number in the folder name
|
||||||
|
$version = $folder.Name -match '(\d+\.\d+\.\d+)'
|
||||||
|
if ($version) {
|
||||||
|
# Replace entire folder name with the version number
|
||||||
|
$new_name = $matches[0]
|
||||||
|
|
||||||
|
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
|
||||||
|
$alpha = $folder.Name -match '(\d+\.\d+\.\d+)([a-zA-Z])'
|
||||||
|
if ($alpha) {
|
||||||
|
$new_name = $matches[1]
|
||||||
|
$new_name = $new_name + $matches[2]
|
||||||
|
}
|
||||||
|
$toadd = New-Object PSObject
|
||||||
|
$toadd | Add-Member -MemberType NoteProperty -Name path -Value $folder.FullName
|
||||||
|
$toadd | Add-Member -MemberType NoteProperty -Name newname -Value $new_name
|
||||||
|
$work += $toadd
|
||||||
|
|
||||||
|
Write-Host "Rename $folder to $new_name"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
# Find the version number in the folder name
|
||||||
|
$version = $folder.Name -match '(\d+\.\d+)'
|
||||||
|
if ($version) {
|
||||||
|
# Replace entire folder name with the version number
|
||||||
|
$new_name = $matches[0]
|
||||||
|
|
||||||
|
# if version has a alpha character, remove it, eg 0.1.0a, then re-add it to new name
|
||||||
|
$alpha = $folder.Name -match '(\d+\.\d+)([a-zA-Z])'
|
||||||
|
if ($alpha) {
|
||||||
|
$new_name = $matches[1]
|
||||||
|
$new_name = $new_name + $matches[2]
|
||||||
|
}
|
||||||
|
$toadd = New-Object PSObject
|
||||||
|
$toadd | Add-Member -MemberType NoteProperty -Name path -Value $folder.FullName
|
||||||
|
$toadd | Add-Member -MemberType NoteProperty -Name newname -Value $new_name
|
||||||
|
$work += $toadd
|
||||||
|
|
||||||
|
Write-Host "Rename $folder to $new_name"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Read-Host -Prompt "Press Enter to continue"
|
||||||
|
foreach ($item in $work) {
|
||||||
|
Rename-Item -Path $item.path -NewName $item.newname
|
||||||
}
|
}
|
71
ScoopManifestReformatter/reformat.ps1
Normal file
71
ScoopManifestReformatter/reformat.ps1
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<#
|
||||||
|
use this order to reformat json objects:
|
||||||
|
version
|
||||||
|
description
|
||||||
|
homepage
|
||||||
|
license
|
||||||
|
notes
|
||||||
|
depends
|
||||||
|
suggest
|
||||||
|
architecture
|
||||||
|
url
|
||||||
|
hash
|
||||||
|
extract_dir
|
||||||
|
extract_to
|
||||||
|
pre_install
|
||||||
|
installer
|
||||||
|
post_install
|
||||||
|
env_add_path
|
||||||
|
env_set
|
||||||
|
bin
|
||||||
|
shortcuts
|
||||||
|
persist
|
||||||
|
pre_uninstall
|
||||||
|
uninstaller
|
||||||
|
post_uninstall
|
||||||
|
checkver
|
||||||
|
autoupdate
|
||||||
|
#>
|
||||||
|
|
||||||
|
# Read all json files in the current directory
|
||||||
|
Get-ChildItem -Filter *.json | ForEach-Object {
|
||||||
|
# Read the file
|
||||||
|
$json = Get-Content $_.FullName | ConvertFrom-Json -Depth 9
|
||||||
|
|
||||||
|
# Create a new object with the properties in the desired order
|
||||||
|
$newJson = [ordered]@{
|
||||||
|
version = $json.version
|
||||||
|
description = $json.description
|
||||||
|
homepage = $json.homepage
|
||||||
|
license = $json.license
|
||||||
|
notes = $json.notes
|
||||||
|
depends = $json.depends
|
||||||
|
suggest = $json.suggest
|
||||||
|
architecture = $json.architecture
|
||||||
|
url = $json.url
|
||||||
|
hash = $json.hash
|
||||||
|
extract_dir = $json.extract_dir
|
||||||
|
extract_to = $json.extract_to
|
||||||
|
pre_install = $json.pre_install
|
||||||
|
installer = $json.installer
|
||||||
|
post_install = $json.post_install
|
||||||
|
env_add_path = $json.env_add_path
|
||||||
|
env_set = $json.env_set
|
||||||
|
bin = $json.bin
|
||||||
|
shortcuts = $json.shortcuts
|
||||||
|
persist = $json.persist
|
||||||
|
pre_uninstall = $json.pre_uninstall
|
||||||
|
uninstaller = $json.uninstaller
|
||||||
|
post_uninstall = $json.post_uninstall
|
||||||
|
checkver = $json.checkver
|
||||||
|
autoupdate = $json.autoupdate
|
||||||
|
}
|
||||||
|
# Remove any null properties
|
||||||
|
$newJson = $newJson | Where-Object { $_.Value -ne $null }
|
||||||
|
|
||||||
|
# Convert the new object back to json and write it back to the file
|
||||||
|
$newJson | ConvertTo-Json -Depth 9 | Set-Content $_.FullName
|
||||||
|
}
|
||||||
|
|
||||||
|
# Run scoop json prettier on all json files in the current directory
|
||||||
|
~/scoop/apps/scoop/current/bin/formatjson.ps1 -Dir .
|
54
ShowTax/showtax.js
Normal file
54
ShowTax/showtax.js
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name New Userscript
|
||||||
|
// @namespace http://tampermonkey.net/
|
||||||
|
// @version 2024-04-12
|
||||||
|
// @description try to take over the world!
|
||||||
|
// @author You
|
||||||
|
// @match https://www.amazon.ca/*
|
||||||
|
// @grant none
|
||||||
|
// @run-at document-idle
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
const TAX = 0.15;
|
||||||
|
|
||||||
|
// Todo: decide if it should just round up to the nearest dollar
|
||||||
|
// Todo: fix queryselectorall only finding one element at a time
|
||||||
|
|
||||||
|
const changeNode = function(node) {
|
||||||
|
var wholeNode = node.querySelector('.a-price-whole');
|
||||||
|
var fractionNode = node.querySelector('.a-price-fraction');
|
||||||
|
var whole = wholeNode ? wholeNode.textContent : '0';
|
||||||
|
var fraction = fractionNode ? fractionNode.textContent : '0';
|
||||||
|
whole = parseInt(whole);
|
||||||
|
fraction = parseInt(fraction);
|
||||||
|
whole += whole * TAX;
|
||||||
|
fraction += fraction * TAX;
|
||||||
|
whole = Math.floor(whole);
|
||||||
|
fraction = Math.floor(fraction);
|
||||||
|
if (fraction >= 100) {
|
||||||
|
whole += 1;
|
||||||
|
fraction -= 100;
|
||||||
|
}
|
||||||
|
if (fraction < 10) {
|
||||||
|
fraction = '0' + fraction;
|
||||||
|
}
|
||||||
|
wholeNode.textContent = whole;
|
||||||
|
fractionNode.textContent = fraction;
|
||||||
|
}
|
||||||
|
|
||||||
|
const find = function() {
|
||||||
|
console.log("Finding price nodes");
|
||||||
|
document.querySelectorAll('.a-price').forEach((node) => {
|
||||||
|
if (node.attributes['found']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
node.attributes['found'] = true;
|
||||||
|
console.log(node);
|
||||||
|
console.log("Price node found")
|
||||||
|
changeNode(node);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//find();
|
||||||
|
setInterval(find, 1000);
|
||||||
|
})();
|
20
SteamToggleUpdate/ToggleFallout4Updates.ps1
Normal file
20
SteamToggleUpdate/ToggleFallout4Updates.ps1
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
$appId = 377160
|
||||||
|
$networkLocation = "https://raw.githubusercontent.com/IsaacShoebottom/Scripts/master/SteamToggleUpdate/ToggleUpdates.ps1"
|
||||||
|
|
||||||
|
# Test if ToggleUpdates.ps1 exists and invoke it if it does
|
||||||
|
If (Test-Path -Path ".\ToggleUpdates.ps1" -PathType Leaf) {
|
||||||
|
.\ToggleUpdates.ps1 $appId
|
||||||
|
}
|
||||||
|
Else {
|
||||||
|
# construct temp path
|
||||||
|
$env:temp = [System.IO.Path]::GetTempPath()
|
||||||
|
$tempPath = $env:temp + "\ToggleUpdates.ps1"
|
||||||
|
|
||||||
|
# Download the network script
|
||||||
|
$wc = New-Object System.Net.WebClient
|
||||||
|
$wc.DownloadFile($networkLocation, $tempPath)
|
||||||
|
# Invoke the network script
|
||||||
|
&$tempPath $appId
|
||||||
|
# Delete the network script
|
||||||
|
Remove-Item -Path $tempPath
|
||||||
|
}
|
29
obs-replay-notification/Beep_on_replay_buffer_save.lua
Normal file
29
obs-replay-notification/Beep_on_replay_buffer_save.lua
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
local obs = obslua
|
||||||
|
local ffi = require("ffi")
|
||||||
|
local winmm = ffi.load("Winmm")
|
||||||
|
|
||||||
|
-- Put a sound of your choosing next to "Beep on replay save.lua" and don't forget to match its name either in code below or rename your file.
|
||||||
|
PROP_AUDIO_FILEPATH = script_path() .. "sound_npc_scanner_scanner_photo1.wav"
|
||||||
|
|
||||||
|
ffi.cdef[[
|
||||||
|
bool PlaySound(const char *pszSound, void *hmod, uint32_t fdwSound);
|
||||||
|
]]
|
||||||
|
|
||||||
|
function playsound(filepath)
|
||||||
|
winmm.PlaySound(filepath, nil, 0x00020000)
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_event(event)
|
||||||
|
if event == obs.OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED
|
||||||
|
then playsound(PROP_AUDIO_FILEPATH)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function script_load(settings)
|
||||||
|
obs.obs_frontend_add_event_callback(on_event)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- This Lua script was downloaded from https://gist.github.com/snakecase/e816384a071cec31efbb4b9e429c108d
|
||||||
|
|
||||||
|
-- Credits: upgradeQ (https://gist.github.com/upgradeQ/b2412242d76790d7618d6b0996c4562f), gima (https://gitlab.com/gima/obsnotification)
|
||||||
|
-- Thank you guys!
|
Binary file not shown.
BIN
obs-replay-notification/sound_npc_scanner_scanner_photo1.wav
Normal file
BIN
obs-replay-notification/sound_npc_scanner_scanner_photo1.wav
Normal file
Binary file not shown.
Reference in New Issue
Block a user