This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let prompt_elements = [ ...document.querySelectorAll( ".stack__answer-question" )[ 0 ].querySelectorAll( "p" ) ]; | |
let tree_walker = document.createTreeWalker( prompt_elements[ 2 ] , NodeFilter.SHOW_ALL , { | |
acceptNode: function ( node ) { | |
return NodeFilter.FILTER_ACCEPT; | |
} | |
} , false ); | |
let done = false; | |
while( done === false ) { | |
let next_node = tree_walker.nextNode(); | |
if ( !next_node ) { done = true; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function quick_hash_string( input_string ) { | |
// https://stackoverflow.com/a/47617289 | |
return input_string.split('').map(v=>v.charCodeAt(0)).reduce((a,v)=>a+((a<<7)+(a<<3))^v).toString(16); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://peter.sh/experiments/chromium-command-line-switches/ | |
# Load-Extension Flag CANNOT have spaces in path or even escaped spaces | |
# https://crxextractor.com | |
# https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm | |
open -n -a "Brave Browser" --args \ | |
-incognito \ | |
-app="https://photopea.com" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for file in "$1"/*.pptx; do | |
file_path=$(readlink -f "$file") | |
osascript "./ExportPPTXToPDF.scpt" "$file_path" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import math | |
import numpy as np | |
from decimal import Decimal | |
AMINO_ACIDS = { | |
"A": { | |
"name": "Alanine" , | |
"3letter": "Ala", | |
"sc_mass": 15.0234, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from pytz import timezone # pip install pytz | |
# print( pytz.country_timezones[ "US" ] ) | |
def get_common_time_string( time_zone=timezone( "US/Eastern" ) ): | |
now = datetime.datetime.now().astimezone( self.timezone ) | |
milliseconds = round( now.microsecond / 1000 ) | |
milliseconds = str( milliseconds ).zfill( 3 ) | |
now_string = now.strftime( "%d%b%Y === %H:%M:%S" ).upper() | |
return f"{now_string}.{milliseconds}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 22 * * * /usr/local/bin/restartMotionServerWithDelay.sh | |
01 10 * * * systemctl stop motion-script.service | |
# @reboot /usr/local/bin/restartMotionServerWithDelay.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
convert frame.jpeg frame.png | |
# https://github.com/radare/tiv | |
tiv frame.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import time | |
import json | |
from pprint import pprint | |
from box import Box # pip install python-box | |
from tqdm import tqdm | |
from concurrent.futures import ThreadPoolExecutor | |
from slugify import slugify # pip install python-slugify==5.0.2 | |
import spotipy # pip install spotipy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import os | |
import json | |
import subprocess | |
import requests | |
import pyperclip | |
def read_json( file_path ): | |
with open( file_path ) as f: |