This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Background Image URL Copier | |
// @namespace Violentmonkey Scripts | |
// @match *://*/* | |
// @noframes | |
// @grant GM_setClipboard | |
// @run-at document-start | |
// @version 1.3 | |
// @author TheDcoder | |
// @description Started working on 4/5/2020, 11:54:15 PM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Synchronous sleep | |
function sleep(ms) { | |
var start = performance.now(); | |
while (performance.now() - start < ms); | |
} | |
// Calling the function will block all code in your script until the specified ms have passed | |
// It will also cause your CPU fans to run at full speed! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function absMin(...values) { | |
return values.find(value => { | |
value = Math.abs(value); | |
return values.every(x => Math.abs(x) >= value); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GUIConstantsEx.au3> | |
#include <WindowsConstants.au3> | |
; #FUNCTION# ==================================================================================================================== | |
; Name ..........: InteractiveCoordinateSelect | |
; Description ...: Lets the user interactively select a point on the screen | |
; Syntax ........: InteractiveCoordinateSelect() | |
; Parameters ....: None | |
; Return values .: Success: An array with the X and Y positions of the selected point | |
; Failure: False (This happens when the overlay window is closed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name DOM Focus Tracker (Console) | |
// @version 0.2 | |
// @description A quick and dirty focus tracker, logs the currently focused element to console | |
// @include * | |
// @run-at document-start | |
// ==/UserScript== | |
window.addEventListener("focusout", event => console.log(event.relatedTarget === null ? "The webpage has lost focus" : event.relatedTarget), true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This snippet will show you a "hack" that you can use in GUI OnEvent mode in AutoIt | |
; With this hack you can create fake/pseudo events for a control in a OnEvent "handler" | |
; function which is registered with multiple controls. | |
; Usually you can get around this by using a unique function for every control | |
; but I like to use a single function that I use as a handler for a group of related | |
; controls. Looks neat and organized :) | |
; Let's get started! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WinAPISys.au3> | |
; #FUNCTION# ==================================================================================================================== | |
; Name ..........: IsWindowNotResponding | |
; Description ...: Checks if a Window is not responding | |
; Syntax ........: IsWindowNotResponding($hWindow[, $iTimeout = 5000]) | |
; Parameters ....: $hWindow - A window handle. | |
; $iTimeout - [optional] Shouldn't matter, Timeout in milliseconds. Default is 5000. | |
; Return values .: @error set by _WinAPI_SendMessageTimeout | |
; Author ........: Damon Harris (TheDcoder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem I do not claim authorship of this snippet, original source: https://serverfault.com/a/227375/414453 | |
rem Get the time from WMI - at least that's a format we can work with | |
set X= | |
for /f "skip=1 delims=" %%x in ('wmic os get localdatetime') do if not defined X set X=%%x | |
echo.%X% | |
rem dissect into parts | |
set DATE.YEAR=%X:~0,4% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; #FUNCTION# ==================================================================================================================== | |
; Name ..........: ConvertTime12To24 | |
; Description ...: Converts 12 hour time to 24 hour time, made while keeping _DateDiff's format in mind :) | |
; Syntax ........: ConvertTime12To24($sTime, $sPeriod[, $sDelimiter = ':']) | |
; Parameters ....: $sTime - Timestamp. (Can be a single digit or a pattern like H:M:S) | |
; $sPeriod - AM or PM. | |
; $sDelimiter - [optional] Separator between units of time. Default is ':'. | |
; Return values .: $sTime in 24 hour format with 0 padding | |
; Author ........: Damon Harris (TheDcoder) | |
; Remarks .......: Ensures that the first 3 parts have 0 padding if the time unit is single digit (Example 09 instead of 9) |