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
#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
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
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
// 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
// ==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
// ==UserScript== | |
// @name GOG Image Hunter | |
// @namespace Violentmonkey Scripts | |
// @match https://email2.gog.com/view.html | |
// @noframes | |
// @grant GM_setClipboard | |
// @run-at document-start | |
// @version 1.1 | |
// @author TheDcoder | |
// @description Started work on 12/4/2020, 8:04: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
#include <unistd.h> | |
#include <signal.h> | |
/* A simply utility to call the POSIX pause function, | |
* it will keep running and while ignoring SIGINT. | |
* | |
* Useful for simulating a hung process | |
*/ | |
int main() { |
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
/* | |
* MIT License | |
* | |
* Copyright (c) 2020 Damon Harris <TheDcoder@protonmail.com> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
#!/usr/bin/env python3 | |
import os | |
import xml.etree.ElementTree as ET | |
HOME_DIR_NAME = '.syncport' | |
CMD_PARAMS = ['-no-restart'] | |
def main(): | |
print("Setting up portable syncthing...") |