Skip to content

Instantly share code, notes, and snippets.

@0187773933
0187773933 / TwitchBlackSquareOverlay.js
Last active September 4, 2023 10:55
Twitch Black Square Overlay - Hide On Screen Chat
// ==UserScript==
// @name Twitch Black Square Overlay - Chess24
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Overlay a black square on Twitch video streams
// @author You
// @match *://*.twitch.tv/chess24*
// @grant none
// ==/UserScript==
@0187773933
0187773933 / PixelDataFromDisplayMedia.js
Created August 15, 2023 15:59
Attempts to Get Pixel Data from Display Media ? Somethings Wrong
( async ()=> {
let stream = await navigator.mediaDevices.getDisplayMedia( { video: true } );
console.log( stream );
let video = document.createElement('video');
video.srcObject = stream;
video.play();
let canvas = document.createElement('canvas');
let ctx = canvas.getContext('2d');
@0187773933
0187773933 / twitchIINABlackBox.sh
Last active August 15, 2023 13:56
Draws a Black Box Overtop of a Twitch Stream
#!/bin/bash
# twitchIINABlackBox playirresponsibly bottom-left 600 400 0 20
# twitchIINABlackBox chess24 bottom-left 800 110 580 0
if [[ "$1" == *"twitch.tv"* ]]; then
url="$1"
else
url="https://twitch.tv/$1"
fi
@0187773933
0187773933 / PhDStipendsDownloader.py
Created August 1, 2023 20:30
PhD Stipends Dot Com Data Downloader
#!/usr/bin/env python3
import requests
import json
def write_json( file_path , python_object ):
with open( file_path , 'w', encoding='utf-8' ) as f:
json.dump( python_object , f , ensure_ascii=False , indent=4 )
def read_json( file_path ):
with open( file_path ) as f:
@0187773933
0187773933 / WebPackGetChunk.js
Created July 14, 2023 22:28
Web Pack Get Chunk By ID
( ()=> {
function get_chunk( chunk_id ) {
for ( let chunk_key in window.webpackChunk ) {
if ( window.webpackChunk[ chunk_key ][ 1 ].hasOwnProperty( chunk_id ) ) {
return window.webpackChunk[ chunk_key ][ 1 ][ chunk_id ];
}
}
}
let chunk = get_chunk( 640151 );
console.log( chunk );
@0187773933
0187773933 / GoogleMapsSearchWithFilters.py
Last active July 6, 2023 16:45
Google Maps Location Search With Filters
#!/usr/bin/env python3
import requests
import json
import time
API_KEY = "asdf"
def miles_to_meters( miles ):
return ( miles * 1609.34 )
@0187773933
0187773933 / VideoExtractTransitionFrames.py
Created June 22, 2023 14:32
Extracts Transition / PowerPoint Frames from Video
#!/usr/bin/env python3
import cv2
import imagehash
import sys
from PIL import Image
import numpy as np
from pathlib import Path
from natsort import humansorted
# pip install opencv-python ImageHash pillow natsort
@0187773933
0187773933 / http.conf
Last active June 25, 2023 14:41
Apache http.conf MP4 Streaming Config
ServerRoot "/usr/local/apache2"
Listen 80
LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
@0187773933
0187773933 / MacOSXPyEnvInstall.sh
Created June 20, 2023 12:41
Mac OSX PyENV Install
#!/bin/bash
echo $SHELL
chsh -s /bin/bash
# iTerm --> Settings --> Profiles --> Default --> General --> Command = Login Shell
# https://github.com/pyenv/pyenv
brew update && brew install pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
@0187773933
0187773933 / ADBWatchEvents.py
Last active June 17, 2023 01:57
ADB Watch Events for Later Replay
#!/usr/bin/env python3
import subprocess
import re
import threading
import time
import json
def write_json( file_path , python_object ):
with open( file_path , 'w', encoding='utf-8' ) as f:
json.dump( python_object , f , ensure_ascii=False , indent=4 )