Skip to content

Instantly share code, notes, and snippets.

View NurudinImsirovic's full-sized avatar

Nurudin Imširović NurudinImsirovic

  • Bosnia and Herzegovina
View GitHub Profile
@NurudinImsirovic
NurudinImsirovic / max-performance-power-plan.cmd
Last active February 4, 2026 19:29
Create and activate Max Performance power plan on Microsoft Windows
rem Restore all defaults first, makes sure the
rem user changes do not interfere with ours.
powercfg -restoredefaultschemes
rem Activate high performance scheme
powercfg /setactive SCHEME_MIN
rem Hard disk\Turn off hard disk after
powercfg /setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0
powercfg /setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0
@NurudinImsirovic
NurudinImsirovic / video2frame.js
Last active February 4, 2026 19:30
Save frame from video element
/**
* Save frame from video element
* @author Nurudin Imsirovic <nurudinimsirovic@yahoo.com>
* @param {Element} video Video element
* @param {boolean} download Download frame as file
* @param {string} filename Download name
* @return {?string} Blob URL of frame
*/
function video2frame(video = null, download = true, filename = null) {
// Not a video element
@NurudinImsirovic
NurudinImsirovic / xhr.js
Last active February 4, 2026 19:31
Asynchronous XMLHttpRequest abstraction
/**
* Asynchronous XMLHttpRequest abstraction.
* @author Nurudin Imsirovic <nurudinimsirovic@yahoo.com>
* @param {string} requestMethod - HTTP Request Method [GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH]
* @param {string} requestSource - URL or relative path to a resource
* @param {string} requestData - Data to be sent (only for POST method)
* @param {function} callback - Callback function for handling the response
* @param {string|null} requestUsername - HTTP Basic Auth Username (default `null`)
* @param {string|null} requestPassword - HTTP Basic Auth Password (default `null`)
* @throws {Error} Throws an error if XMLHttpRequest is not supported or if the callback is not a function.