Skip to content

Instantly share code, notes, and snippets.

View bazuzu931's full-sized avatar
💭
you're tearing me apart lisa!

bazuzu931 bazuzu931

💭
you're tearing me apart lisa!
View GitHub Profile
@bazuzu931
bazuzu931 / README.md
Created December 13, 2023 09:40 — forked from denilsonsa/README.md
Embed VTT subtitles into HTML

Objective

I have a video file on my local disk. I also have some subtitles (in HTML5's [WebVTT][] format).

I want to create an HTML file to play that video with subtitles, all from the local filesystem.

Problem

Loading an external VTT file from the local filesystem [fails due to same-origin policy][q].

@bazuzu931
bazuzu931 / loop float - python
Created December 10, 2023 08:23
loop float - python
def decimal_range(start, stop, increment):
while start < stop: # and not math.isclose(start, stop): Py>3.5
yield start
start += increment
for i in decimal_range(0.1, 10.1, 0.1):
i = round(float(i), 1)
print(i)
! 2023-10-13 https://www.youtube.com
www.youtube.com##tp-yt-paper-dialog.ytd-popup-container.style-scope
www.youtube.com##.opened
! 2023-10-19 https://www.youtube.com
www.youtube.com##.yt-playability-error-supported-renderers.style-scope > .ytd-enforcement-message-view-model.style-scope
www.youtube.com###container > .yt-playability-error-supported-renderers.style-scope
www.youtube.com###error-screen > .yt-playability-error-supported-renderers.style-scope
www.youtube.com###error-screen
- ncdu
-
@bazuzu931
bazuzu931 / links
Created October 8, 2023 15:31
links
@bazuzu931
bazuzu931 / appium(android) keyEvent table
Last active August 11, 2023 06:36
appium(android) keyEvent table
''' Unknown key code. '''
KEYCODE_UNKNOWN = 0
''' Soft Left key.
* Usually situated below the display on phones and used as a multi-function
* feature key for selecting a software defined function shown on the bottom left
* of the display. '''
KEYCODE_SOFT_LEFT = 1
''' Soft Right key.
* Usually situated below the display on phones and used as a multi-function
* feature key for selecting a software defined function shown on the bottom right
@bazuzu931
bazuzu931 / delete globally all node modules
Created August 2, 2023 19:01
delete globally all node modules
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm
@bazuzu931
bazuzu931 / Install Android SDK Linux
Last active August 9, 2023 19:11
Install Android SDK Linux
cd ~/android/sdk
sudo wget https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip
sudo unzip commandlinetools-linux-9123335_latest.zip
cd cmdline-tools
mkdir tools
mv -i * tools
nano ~/.bashrc
export ANDROID_HOME=$HOME/android/sdk
export PATH=$ANDROID_HOME/cmdline-tools/tools/bin/:$PATH
@bazuzu931
bazuzu931 / install_gradle.txt
Created August 1, 2023 15:23
install gradle
sudo apt install default-jdk -y
java --version
wget -c https://services.gradle.org/distributions/gradle-7.4.2-bin.zip -P /tmp
sudo unzip -d /opt/gradle /tmp/gradle-7.4.2-bin.zip
sudo nano /etc/profile.d/gradle.sh
export GRADLE_HOME=/opt/gradle/gradle-7.4.2
export PATH=${GRADLE_HOME}/bin:${PATH}
sudo chmod +x /etc/profile.d/gradle.sh
@bazuzu931
bazuzu931 / Functions
Last active September 12, 2023 09:27
Functions
===========================================================================================
ll = ['11', '#22', '33']
if any((c := x).startswith('#') for x in ll):
print('Yes')
===========================================================================================
from collections import Counter