Skip to content

Instantly share code, notes, and snippets.

@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 30, 2025 12:56
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 )
@0187773933
0187773933 / MDToJPEG.py
Last active June 21, 2023 12:01
Markdown + KaTeX + mhchem to JPEG Converter
#!/usr/bin/env python3
# brew install wkhtmltopdf
# pip install imgkit markdown
import os
import imgkit
import markdown
import asyncio
import nest_asyncio
import time
from pyppeteer import launch
@0187773933
0187773933 / RenderMDWithKaTeX.html
Created June 7, 2023 20:27
Render MD with KaTeX to HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MD + Katex Render Test</title>
<script defer src="https://39363.org/CDN/marked.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-G0zcxDFp5LWZtDuRMnBkk3EphCK1lhEf4UEyEM693ka574TZGwo4IWwS6QLzM/2t" crossorigin="anonymous"></script>
@0187773933
0187773933 / ConvertGoogleSavedPlacesToKML.py
Last active February 28, 2024 15:39
Convert Google Takeout Saved / Starred Places GeoJSON to KML File
#!/usr/bin/env python3
import sys
import json
from pygeoif.geometry import Point
from fastkml import kml
from pprint import pprint
from pathlib import Path
import googlemaps
from urllib.parse import urlparse , parse_qs , unquote