Binary downloads for all OS's here.
Mac with brew:
brew install chromedriver
Located at /usr/local/bin/chromedriver
# python3 aiofiles_test.ty some_file_with_newlines | |
import sys | |
import asyncio | |
import aiofiles | |
async def read(filename): | |
async with aiofiles.open(filename, mode='r') as f: | |
return await f.read() |
# A script to download all the videos from | |
# https://archive.org/details/ucberkeley-webcast-PL3E89002AA9B9879E?sort=titleSorter | |
# python3.7 | |
# pip3 install --user selenium youtube-dl | |
import youtube_dl | |
from selenium import webdriver | |
driver = None |
#!/usr/bin/env python3 | |
""" | |
Opens xkcd's downloaded using xkcd-dl chronologically using the show_xkcd function from | |
https://github.com/tasdikrahman/xkcd-dl/ | |
Assumes you already have the xkcd's downloaded in the xkcd_archive folder (i.e. using --download-all) | |
(though you could just have the start/end folders in xkcd_archive and xkcd-dl would download them when asked to open) | |
Can pass a start xkcd like: |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def main(): | |
return "Hello world" | |
def generate_style(class_name, color): |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Flexbox Example</title> | |
<style> | |
.flexbox { | |
margin: 100px auto 0 auto; /* basic margins */ | |
min-height: 400px; /* minimum height of 500px, as long as the things inside dont grow beyond that */ | |
height: auto; /* if div's inside are larger than 500px, this should 'auto'matically grow */ | |
width: 80%; /* 80% of page next container up (the body, whole page) */ |
# Didnt end up using this, but it could be useful in the future. | |
class LagTracker: | |
"""A class representing a moving average; lag time between sending messages""" | |
__slots__ = ["latency", "cur_avg"] | |
def __init__(self): | |
self.latency = [] | |
self.cur_avg = 0 |
sudo killall apt apt-get | |
sudo rm /var/lib/apt/lists/lock | |
sudo rm /var/cache/apt/archives/lock | |
sudo rm /var/lib/dpkg/lock* | |
sudo dpkg --configure -a | |
sudo apt update && sudo apt upgrade |
# Open a terminal, and run these: | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew update && brew upgrade | |
brew install youtube-dl | |
cd ~/Downloads # the music should be downloaded to Downloads | |
youtube-dl -f best --extract-audio --audio-format mp3 SONG/VIDEO_URL_HERE # to convert a video to mp3/download a mp3 | |
youtube-dl -f best VIDEO_URL_HERE # download a video |