Skip to content

Instantly share code, notes, and snippets.

View buzamahmooza's full-sized avatar

Faris hijazi buzamahmooza

View GitHub Profile
@buzamahmooza
buzamahmooza / 32x8.com input assistant.js
Created October 12, 2018 18:04
A bookmarklet or browser script to allow for easy input on the 32x8.com kmap website. rather then ticking radio buttons one by one, this script takes on string and ticks all the radio buttons for you.
JavaScript:(function(){
if(!/www\.32x8\.com/.test(location.href)){ alert("This script only works on 32x8.com"); return; }
stringInput(prompt("Enter the minterms/maxterms in order from top to bottom (0,1,x):", "1 x 1 0 1 0 x 0"));
function stringInput(inputStr) {
const rows = Array.from(document.querySelectorAll('body > form > table > tbody tr')).slice(2, -1);
const terms = inputStr.match(/(1|0|x)/gmi);
console.log('terms:', terms);
for(let i=0; i<terms.length; i++){
if(i>=terms.length || i>=rows.length) break;
var idx=0;
@buzamahmooza
buzamahmooza / ocrad.min.js
Created April 9, 2018 11:45
A minified version of ocrad.js [I did NOT write the code] Creator of the code: https://github.com/antimatter15/ocrad.js Minified using: http://dean.edwards.name/packer/
This file has been truncated, but you can view the full file.
var OCRAD=(function(){function createOcradInstance(){var jf;if(!jf)jf=(typeof jf!=='undefined'?jf:null)||{};var jg={};for(var jh in jf){if(jf.hasOwnProperty(jh)){jg[jh]=jf[jh]}}var ji=false;var jj=false;var jk=false;var jl=false;if(jf['ENVIRONMENT']){if(jf['ENVIRONMENT']==='WEB'){ji=true}else if(jf['ENVIRONMENT']==='WORKER'){jj=true}else if(jf['ENVIRONMENT']==='NODE'){jk=true}else if(jf['ENVIRONMENT']==='SHELL'){jl=true}else{throw new Error('The provided Module[\'ENVIRONMENT\'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.');}}else{ji=typeof window==='object';jj=typeof importScripts==='function';jk=typeof process==='object'&&typeof require==='function'&&!ji&&!jj;jl=!ji&&!jk&&!jj}if(jk){if(!jf['print'])jf['print']=console.log;if(!jf['printErr'])jf['printErr']=console.warn;var jm;var jn;jf['read']=function read(a,b){if(!jm)jm=require('fs');if(!jn)jn=require('path');a=jn['normalize'](a);var c=jm['readFileSync'](a);if(!c&&a!=jn['resolve'](a)){a=path.join(__dirname,'..','src',a);c=jm['readFileSync'
@buzamahmooza
buzamahmooza / Pinterest DL All Original Images.js
Created March 3, 2018 17:33
A bookmarklet to downloads all original images on a pinterest page. Just drag the code to your bookmarks or save it and add "JavaScript:" in the beginning, visit pinterest and click that bookmark, boom! magic!
if(typeof download !== 'function') {
alert("The download function was not found on this page, please run the 'downoader' script using tampermonkey."); void(0);
}
if(/www\.pinterest\./.test(location.href)){
var imgBoxes = document.querySelectorAll('._qk._2h._ql');
console.log('ImgBoxes:', imgBoxes);
if(confirm('Download '+imgBoxes.length+' images?'))
imgBoxes.forEach(function(imgBox, index, array){
try{
let img = imgBox.querySelector('img[srcset]');
@buzamahmooza
buzamahmooza / Go to original zscalar link.js
Created January 22, 2018 12:26
Redirects you to the url that ZScalar has blocked. This script is helpful when you want to visit a page (outside the ZScalar network) but you only have the ZScalar link to it.
@buzamahmooza
buzamahmooza / Faris Handy Webdev JavaScript functions.user.js
Created January 15, 2018 13:17
A library for my commonly used JavaScript functions with user scripts.
// ==UserScript==
// @name Faris Handy Webdev JavaScript functions
// @namespace http://tampermonkey.net/
// @version 0.1
// @description A bunch of useful JavaScript functions
// @description This is not a regular script for you to run! Only use this via the @require keyword.
// @author Faris Hijazi
// @grant unsafeWindow
// ==/UserScript==
@buzamahmooza
buzamahmooza / Add video keyboard shortcuts.user.js
Last active November 18, 2023 21:23
Adds keyboard shortcuts to HTML5 videos.
// ==UserScript==
// @name Video keyboard shortcuts
// @namespace https://github.com/buzamahmooza
// @version 0.5
// @description Adds keyboard shortcuts to HTML5 videos.
// Left Click: Toggle Pause/Play
// F or dblClk: Toggle Fullscreen
// SpaceBar: Toggle Pause/Play
// Left/Right: Navigate back/forward
// -,[ / =,]: - / + Playback speed
@buzamahmooza
buzamahmooza / Google Search Site Images.user.js
Last active January 24, 2018 11:03
Redirects you to Google images and searches for pictures of the text selection or the site URL. (If any text is selected )
q=(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);
location.href="https://www.google.com/search?&tbm=isch&q="+((typeof q!=='string'||q.length<1?("site:"+location.hostname):(''+q)).replace(/\s+/g,"+"));
console.log('q=', q);
void(0);
@buzamahmooza
buzamahmooza / RARBG_Add Link & thumbnails.user.js
Last active February 6, 2018 11:30
Add a magnet link shortcut and thumbnails of torrents. Also adds a google image search link in case you want to see more pics of the torrent.