Skip to content

Instantly share code, notes, and snippets.

View x0a's full-sized avatar

x0a

View GitHub Profile
const getRandomizedBoxes = ()=>{
const getRandomInt = (min,max)=>{
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min);
//The maximum is exclusive and the minimum is inclusive
}
const boxes = Array(100);
@x0a
x0a / redditvideoquality.user.js
Last active September 22, 2023 16:12
Forces the highest quality video on Reddit
// ==UserScript==
// @name Force highest resolution on Reddit
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Parses the mpd file sent to reddit's video player and removes all but the highest resolution representations for each video period
// @author x0a
// @run-at document-start
// @match https://www.reddit.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant none
@x0a
x0a / http-live-player.js
Created March 22, 2020 18:42
FFmpeg-based replacement for h264-live-player
This file has been truncated, but you can view the full file.
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.WSAvcPlayer = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (__dirname){
((function(root,factory){if(typeof define==="function"&&define.amd){define([],factory)}else if(typeof exports==="object"){module.exp
@x0a
x0a / nextiva.ahk
Created December 20, 2019 16:59
Press shift key to answer calls from Nextiva
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Shift::
if WinExist("ahk_class Qt5QWindowToolSaveBits ahk_exe Communicator.exe") {
WinActivate, ahk_class Qt5QWindowToolSaveBits ahk_exe Communicator.exe
Send, `t`t{Enter}
}
#!/bin/sh
# Place into the location of your Popcorn-Time installation and run
desktop_file="Popcorn-Time.desktop"
icon=`readlink -f ./src/app/images/icon.png`
binary=`readlink -f ./Popcorn-Time`
cwd=`readlink -f .`
echo "[Desktop Entry]" > $desktop_file
@x0a
x0a / zcam.sh
Last active November 28, 2019 23:45
Zmodo Viewer, bash: View multiple cams in a grid with MPlayer
#!/bin/bash
server="securitysystem" # my router-defined hostname for my dvr, use ip instead
port=8000
res_x=960 # cam resolution, mine is 960H grabbed from running show_cam once w/o -really-silent and watching the output
res_y=480
cams=(1 3 4) #show cams 1, 3, and 4, skipping 2 since mine isn't connected
function get_current_workspace() {
workspace=`wmctrl -d | grep '*' | cut -d ' ' -f1`
}
@x0a
x0a / beforescriptexecute-polyfill.js
Last active June 30, 2023 12:23
Lightweight beforescriptexecute / onbeforescriptexecute polyfill
(function(){
if("onbeforescriptexecute" in document) return; // Already natively supported
let scriptWatcher = new MutationObserver(mutations => {
for(let mutation of mutations){
for(let node of mutation.addedNodes){
if(node.tagName === "SCRIPT"){
let syntheticEvent = new CustomEvent("beforescriptexecute", {
detail: node,
cancelable: true