Compare commits
15 Commits
30f67ab42b
...
master
Author | SHA1 | Date | |
---|---|---|---|
5b3c01607d | |||
c11cf9202f | |||
4a7a367547 | |||
0085d4dee2 | |||
d3648342e5 | |||
642edffcfe | |||
b449ded8fe | |||
93a2d7e329 | |||
7be7397ab1 | |||
e66fdf942a | |||
d2c5e8cdb9 | |||
fc62233d3f | |||
5caeecb0e7 | |||
271c4bfc92 | |||
7d90433a9a |
10
JavaScripts/HelloWorld
Executable file
10
JavaScripts/HelloWorld
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/env -S java --source 11
|
||||
|
||||
class Main {
|
||||
public static void main(String args[]) {
|
||||
System.out.println("HelloWorld!");
|
||||
|
||||
// Print the sum of 1 and 2
|
||||
System.out.println(1 + 2);
|
||||
}
|
||||
}
|
@ -92,7 +92,9 @@ def sanity_check():
|
||||
print("Would you like to clear backups? (y/n)")
|
||||
answer = input().lower()
|
||||
if answer == "y":
|
||||
os.remove(RESOURCES_PATH + ASAR_BACKUP)
|
||||
if os.path.isfile(RESOURCES_PATH + ASAR_BACKUP):
|
||||
os.remove(RESOURCES_PATH + ASAR_BACKUP)
|
||||
print("Backup cleared, installation will continue as normal")
|
||||
print("Backups cleared, installation will continue as normal")
|
||||
else:
|
||||
print("Backups not cleared, please clean manually")
|
||||
|
@ -26,7 +26,7 @@ if (Test-Path $location) {
|
||||
Write-Host $newPipConfig
|
||||
|
||||
# Write the new content to the file
|
||||
$newPipConfig | Out-File $location -Force
|
||||
$newPipConfig | Out-File $location -Force -Encoding utf8
|
||||
} else {
|
||||
# If it doesn't exist, create it
|
||||
New-Item -Path $location -ItemType File
|
||||
|
72
RemoveVersion/RemoveVersion.ps1
Normal file
72
RemoveVersion/RemoveVersion.ps1
Normal file
@ -0,0 +1,72 @@
|
||||
# Get each folder in the current directory
|
||||
$folders = Get-ChildItem -Directory
|
||||
|
||||
# Array to store the folders that need to be renamed
|
||||
$work = @()
|
||||
|
||||
foreach ($folder in $folders) {
|
||||
# Find the version number in the folder name
|
||||
$version = $folder.Name -match '(\d+\.\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+\.\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+\.\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
|
||||
}
|
26
ScoopCompare/ScoopCompare.js
Normal file
26
ScoopCompare/ScoopCompare.js
Normal file
@ -0,0 +1,26 @@
|
||||
// Run with node
|
||||
|
||||
// Read ~/scoop/apps.json and compare it to scoop export
|
||||
// Then display the differences in the installed apps and the apps.json file
|
||||
|
||||
// read apps.json file
|
||||
let fs = require('fs');
|
||||
let apps = fs.readFileSync('C:/Users/Isaac/scoop/apps.json', 'utf8');
|
||||
apps = JSON.parse(apps);
|
||||
apps = apps.apps;
|
||||
|
||||
// run scoop export in shell and save output to variable
|
||||
let { execSync } = require('child_process');
|
||||
let installedApps = execSync('scoop export').toString();
|
||||
installedApps = JSON.parse(installedApps);
|
||||
installedApps = installedApps.apps;
|
||||
|
||||
// Make a set out of each of the arrays on the Name property
|
||||
let appsSet = new Set(apps.map(app => app.Name));
|
||||
let installedAppsSet = new Set(installedApps.map(app => app.Name));
|
||||
|
||||
// Find the difference between the two sets
|
||||
let diffFromInstalledApps = new Set([...appsSet].filter(x => !installedAppsSet.has(x)));
|
||||
let diffFromApps = new Set([...installedAppsSet].filter(x => !appsSet.has(x)));
|
||||
console.log("Apps in apps.json but not installed: ", diffFromInstalledApps);
|
||||
console.log("Apps installed but not in apps.json: ", diffFromApps);
|
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);
|
||||
})();
|
@ -1,16 +1,26 @@
|
||||
param (
|
||||
[int] [alias('p')] $port = 21,
|
||||
[string] [alias('d')] $directory = '.',
|
||||
[bool] [alias('w')] $write = $false
|
||||
)
|
||||
|
||||
$venv = "\.pyftplib"
|
||||
$venv = $HOME + $venv
|
||||
# Create virtual environment
|
||||
if (-not (Test-Path venv)) {
|
||||
virtualenv venv
|
||||
if (-not (Test-Path $venv)) {
|
||||
write-host "Creating virtual environment at $venv"
|
||||
virtualenv "$venv"
|
||||
}
|
||||
|
||||
# Activate virtual environment
|
||||
.\venv\Scripts\activate.ps1
|
||||
. ($venv + "\Scripts\Activate.ps1")
|
||||
|
||||
# Install dependencies
|
||||
pip install pyftpdlib
|
||||
|
||||
# Run FTP server
|
||||
python -m pyftpdlib
|
||||
|
||||
# Not working for streaming video files
|
||||
# twistd -n ftp -r .
|
||||
if ($write) {
|
||||
python -m pyftpdlib -p $port -d $directory -w
|
||||
} else {
|
||||
python -m pyftpdlib -p $port -d $directory
|
||||
}
|
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
|
||||
}
|
@ -1,7 +1,12 @@
|
||||
# function that takes in an app id as a number and returns the path to the steam library folder that contains the app id
|
||||
function parseVDFforPath([int]$appId) {
|
||||
# Steam libary folder vdf if using scoop
|
||||
$scoopVDF = "$env:USERPROFILE\scoop\apps\steam\current\steamapps\libraryfolders.vdf"
|
||||
# Steam library folders vdf absolute path
|
||||
$steamLibraryFoldersVDF = "C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf"
|
||||
$normalVDF = "C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf"
|
||||
|
||||
# Set the path to the vdf file based on whether you are using scoop or not
|
||||
$steamLibraryFoldersVDF = if (Test-Path $scoopVDF) { $scoopVDF } else { $normalVDF }
|
||||
|
||||
# convert the app id to a string
|
||||
$appIdString = $appId.ToString()
|
||||
|
4
mcrcon/rcon.ps1
Normal file
4
mcrcon/rcon.ps1
Normal file
@ -0,0 +1,4 @@
|
||||
$ip = "localhost"
|
||||
$ip = Read-Host -Prompt 'Enter the RCON IP (default: localhost)'
|
||||
$password = Read-Host -MaskInput -Prompt 'Enter the RCON Password'
|
||||
mcrcon -H $ip -p $password
|
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