Skip to content

Instantly share code, notes, and snippets.

View FarisHijazi's full-sized avatar
:shipit:
ඞඞඞ

Faris Hijazi FarisHijazi

:shipit:
ඞඞඞ
View GitHub Profile
@FarisHijazi
FarisHijazi / googleimages_parse2020format2rg_meta.js
Created April 7, 2020 21:49
Google images new format (2020) is unparsable (unlike using `.rg_meta`), this script will parse the first 100 or so images on a google images page and return
// code to get this:
/**
* @author github.com/FarisHijazi
*
* @returns {{ "id": String, "tu": String, "th": String, "tw": String, "ou": String, "oh": String, "ow": String, "pt": String, "st": String, }[]}
* returns a list of objects, these contain the image info
*
* how it works:
* there's a <script> that contains the images info, the code in it contains `AF_initDataCallback`
@FarisHijazi
FarisHijazi / Unzip_and_delete.reg
Last active January 7, 2025 19:33
7zip: Unzip and delete context menu. Registry entry and .bat file for windows context menu "unzip and delete" command. instead of needing to unzip, then delete an archive manually
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Unzip and delete]
"icon"="C:\\Program Files\\7-Zip\\7zG.exe"
[HKEY_CLASSES_ROOT\*\shell\Unzip and delete\command]
@="\"<PATH TO>\\unzip_and_delete.bat\" \"%1\""
@FarisHijazi
FarisHijazi / snoopProperty.js
Created May 12, 2019 19:07
JavaScript snoop properties of objects. Bind callbacks to getters and setters for all properties of an object. Useful for observing how a page element has its properties accessed
/**
* Snoops on an object, monitors all attempts to access and set properties
* @param {Object} obj - the object to monitor
* @param {string[]=} props - list of properties to watch, watches all properties by default
* @param {Function=} onset - callback when the property is set (newValue is passed)
* @param {Function=} onget - callback when the property is accessed
* @param verbose
*/
function snoopProperty(obj, props = [], onset = (val) => null, onget = () => null, verbose = true) {