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 requests | |
| from pprint import pprint | |
| from box import Box | |
| from pathlib import Path | |
| import shutil | |
| import json | |
| from tqdm import tqdm | |
| from concurrent.futures import ThreadPoolExecutor | |
| import urllib.parse |
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 | |
| CLIENT_ID="asdf" | |
| CLIENT_SECRET="asdf" | |
| REDIRECT_URI="http://localhost:3033/" | |
| # 1.) refresh client credentials ( this is a less permissive client credential auth token ) | |
| # curl -s -X POST 'https://id.twitch.tv/oauth2/token' \ | |
| # -H 'Content-Type: application/x-www-form-urlencoded' \ | |
| # -d 'client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&grant_type=client_credentials' |
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
| powershell -Command "& {$file = Get-Content -Path $args[0] -Encoding Byte -TotalCount 16; $hex = ($file | % { $_.ToString('X2') }) -join ' '; $ascii = [System.Text.Encoding]::ASCII.GetString($file); Write-Host 'Hex: ' $hex; Write-Host 'ASCII: ' $ascii}" Other_2 |
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 glob | |
| import collections # cause of yew python 3.10 | |
| import collections.abc # cause of yew python 3.10 | |
| # import pptx # pip install python-pptx | |
| from pptx import Presentation | |
| from pptx.util import Inches | |
| from pptx.dml.color import RGBColor | |
| from PIL import Image |
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
| def get_percent_error( value , target ): | |
| return ( ( abs( value - target ) / target ) * 100.0 ) | |
| def get_spike_properties( voltages , times ): | |
| threshold = -70.2 # mV | |
| voltage_recordings_np = voltages.as_numpy() | |
| time_recordings_np = times.as_numpy() | |
| peak_voltage = np.max( voltage_recordings_np ) |
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 wait_on_element( query_selector , check_interval=500 , timeout=20000 ) { | |
| return new Promise( function( resolve , reject ) { | |
| try { | |
| let READY_CHECK_INTERVAL = setInterval( function () { | |
| let element = document.querySelectorAll( query_selector ); | |
| if ( element ) { | |
| if ( element[ 0 ] ) { | |
| clearInterval( READY_CHECK_INTERVAL ); | |
| resolve( element[ 0 ] ); | |
| return; |
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://launchpad.net/ubuntu/+cdmirrors | |
| SourcesFilePath="/etc/apt/sources.list" | |
| MirrorURL="https://mirrors.cat.pdx.edu/ubuntu" | |
| DistName="jammy" | |
| EndPoints=( | |
| " main restricted" | |
| "-updates main restricted" | |
| " universe" |
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
| Get-ChildItem -Path . -Filter *.mkv | Sort-Object { [int]($_.Name -replace '.*_t(\d{2}).mkv', '$1') } | foreach { $_.FullName } | foreach { "file '$_'" } | Out-File -Encoding ascii -FilePath output.txt; Get-Content .\output.txt; ffmpeg -y -safe 0 -f concat -i output.txt -c copy combined.mp4; Remove-Item .\output.txt |
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 collections # cause of yew python 3.10 | |
| import collections.abc # cause of yew python 3.10 | |
| import pptx # python-pptx | |
| def get_highest_shape_object( slide ): | |
| potentials = [] | |
| for index , shape in enumerate( slide.shapes ): | |
| potentials.append( [ shape.top , shape ] ) |
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 requests | |
| from pprint import pprint | |
| TOKEN = "API_TOKEN" | |
| USERNAME = "GITHUB_USERNAME" | |
| API_BASE_URL = "https://api.github.com" | |
| # https://docs.github.com/en/rest/repos/repos#update-a-repository | |
| if __name__ == "__main__": |