Skip to content

Instantly share code, notes, and snippets.

View AScriver's full-sized avatar
🚩
Learning

Austin AScriver

🚩
Learning
View GitHub Profile
@AScriver
AScriver / RecurringJob.php
Created February 27, 2024 19:06 — forked from jesperborgstrup/RecurringJob.php
Quick way to perform recurring jobs with php-resque-scheduler
<?php
use Resque;
use ResqueScheduler\ResqueScheduler;
/**
* Base class for recurring Resque jobs.
*
* Jobs must implement the recurrentSetUp(), recurrenctPerform(), and recurrentTearDown()
* methods instead of the normal setUp(), perform(), and tearDown() methods.
*
@AScriver
AScriver / afk.py
Created January 18, 2024 00:23
Roblox anti-afk script that uses a virtual controller to simulate input.
import time
## fix ms-gamebar annoyance after uninstalling Xbox: https://www.reddit.com/r/Windows11/comments/vm046d/is_there_any_way_to_remove_the_xbox_game_bar/ie0j6o3/
# Try importing the required packages
try:
import vgamepad as vg
import pygetwindow as gw
import win32gui
@AScriver
AScriver / settings.ps1
Created August 13, 2023 00:57
Open different Windows settings from powershell
# https://ss64.com/ps/syntax-settings.html
Clear-Host
Write-Host " ===== Run a Settings App ====="
Write-Host
function Show-Menu {
Write-Host " Enter 'A' for Accessibility settings."
Write-Host " Enter 'B' for Apps settings."
Write-Host " Enter 'O' for Audio settings."
@AScriver
AScriver / cleanup-win10.ps1
Last active March 18, 2023 18:59 — forked from halkyon/cleanup-win10.ps1
Cleanup Windows 10 Powershell script
## Instructions
## 1. Run this script (under Powershell as Administrator):
## powershell -ExectionPolicy Bypass .\cleanup-win10.ps1
## 2. Let it run through, you may see a few errors, this is normal
## 3. Reboot
## shutdown /r /t 0
## 5. Done!
##
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
@AScriver
AScriver / StringCompare.sql
Last active November 16, 2022 17:39
Finds degree of similarity between two strings, based on Dice's Coefficient, using SQL/T-SQL
-- Finds degree of similarity between two strings, based on Dice's Coefficient
DROP FUNCTION IF EXISTS dbo.CompareTwoStrings
GO
CREATE FUNCTION dbo.CompareTwoStrings (
@string1 nvarchar(4000)
, @string2 nvarchar(4000)
) RETURNS NUMERIC(10, 10)
AS BEGIN
DECLARE @i INT
@AScriver
AScriver / SSMSSavedConnections.ps1
Created October 7, 2022 18:28
Dumps connection strings saved in SSMS
Invoke-Sqlcmd | Out-Null
Get-ChildItem 'SQLSERVER:\sqlregistration\Database Engine Server Group' -Recurse `
| Where-Object {$_ -is [Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer]} `
| Select-Object DisplayName, ConnectionString `
| ConvertTo-Json -Depth 3 -Compress `
| Out-File -FilePath .\output.json
@AScriver
AScriver / csv2xlsx.bat
Created October 7, 2022 18:23
Converts a csv file to .xlsx
@if (@X)==(@Y) @end /* JScript comment
@echo off
if [%1]==[] (
echo Drag and drop a CSV file onto this one!
pause
)
cscript //E:JScript //nologo "%~f0" %*
exit /b %errorlevel%
@if (@X)==(@Y) @end JScript comment */
@AScriver
AScriver / restoreConsole.js
Created October 7, 2022 18:12
Restores window.console
const i = document.createElement('iframe');
i.style.display = 'none';
document.body.appendChild(i);
window.console = i.contentWindow.console;
@AScriver
AScriver / addedWindowProps.js
Created October 7, 2022 18:11
Logs any properties that have been added to the Window object.
const i = document.createElement('iframe');
i.style.display = 'none';
document.body.appendChild(i);
const obj = {};
Object.keys(window)
.filter(value => Object.keys(i.contentWindow).indexOf(value) < 0)
.forEach(key => obj[key] = window[key]);
@AScriver
AScriver / logCustomElements.js
Last active October 7, 2022 18:04
Log Custom Elements / Web Components to console
console.log(
Array.from(document.querySelectorAll('*'))
.filter((el) => customElements.get(el.nodeName.toLowerCase()) !== undefined || el.getAttribute("is"))
)