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 json | |
| import inspect | |
| # pprint( inspect.getmembers( midi ) ) | |
| from pathlib import Path | |
| from pprint import pprint | |
| import music21 | |
| from music21 import * |
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 | |
| from music21 import * | |
| from pathlib import Path | |
| keys = [ "A" , "B" , "C" , "D" , "E" , "F" , "G" ] | |
| key_modifiers = [ '####' , '###' , '##' , '#~' , '#' , '~' , '----' , '---' , '--' , '-`' , '-' , '`' , '' ] | |
| key_modifier_names = [ 'quadruple-sharp' , 'triple-sharp' , 'double-sharp' , 'one-and-a-half-sharp' , 'sharp' , 'half-sharp' , 'quadruple-flat' , 'double-flat' , 'one-and-a-half-flat' , 'flat' , 'half-flat' , 'natural' ] | |
| if __name__ == "__main__": |
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
| https://github.com/borgbackup/borg | |
| https://borgbackup.readthedocs.io/en/stable/internals/data-structures.html#chunker-details | |
| 1.) Init New Repo | |
| borg init --encryption repokey-blake2 /Volumes/63614TB/COMBINED_BACKUP/BORG | |
| 2.) Export and Save the Key | |
| borg key export /Volumes/63614TB/COMBINED_BACKUP/BORG | |
| # BORG_KEY asdfasdfasdfasdf |
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
| // https://greasyfork.org/en/scripts/370246-sci-hub-button/code | |
| var wsu_ico = "data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABWWlDQ1BJQ0MgUHJvZmlsZQAAKJFtkDFLw1AUhU+kUpAoQnUQRLIpJRVNpU4dYoWiOISqYN3SNEmFtH0kKSougqMdHR10F0QQHFVQEBwF8ReIi+BUB8V4X6umVS9c7sfh8O59B+iK6Iw5EQDliu/msjPSSn5Vij5CRDdiJA/rhsdUTVsgxvfsrMY9BD7vEvytaXn08uK4NpiPldWjwxH3r7+jeoqmZ9B8p44bzPUBYYxYW/cZ5w3iAZeOIq5ztlt8wLnQ4tOmZymXIb4h7jdKepH4gVgutOl2G5edmvF1A79eNCvLizT7+J8xiyQUWEggi0nK5n/vVNObQRUMm3CxBhsl+JCgksLgwCSeQwUGxiETK5igVnjGv7MLNfMWSM3TqutQs/aB8xStPgu1eJXi2wauTpju6j+JCo2IZyWVFg+J5NkJgie6tXcL+HgOgteXIHjbA6JpoL77CQWRX4C9F6QVAAAAXGVYSWZNTQAqAAAACAAEAQYAAwAAAAEAAgAAARIAAwAAAAEAAQAAASgAAwAAAAEAAgAAh2kABAAAAAEAAAA+AAAAAAACoAIABAAAAAEAAAAkoAMABAAAAAEAAAAkAAAAAPhgTFUAAAK0aVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIi |
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}" |