This file contains 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 modulus(a, b) { | |
let c = parseInt(a / b) | |
let d = c * b | |
return a - d | |
} |
This file contains 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 humanize(minutes) { | |
return `${(minutes / 60).toFixed(0)} Hours ${minutes % 60} Minutes` | |
} |
This file contains 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
async fn stream_song() -> impl Responder { | |
let media = "MEDIA PATH" | |
let bitrate = 1000; | |
let start = 0; | |
let end = seconds * bitrate * 1000 / 8; // convert seconds to bytes | |
let mut file = File::open(media).unwrap(); | |
file.seek(SeekFrom::Start(start)).unwrap(); |
This file contains 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
git reset --soft HEAD~ |
This file contains 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 os | |
import argparse | |
parser = argparse.ArgumentParser(description="A File Counter") | |
# Arguments | |
parser.add_argument("directory", help="The directory that you would like to scan") | |
args = parser.parse_args() |
This file contains 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 requests | |
from bs4 import BeautifulSoup | |
def main(): | |
page = requests.get("https://www.clastify.com/ia/chemistry", headers={'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'}) | |
soup = BeautifulSoup(page.content, 'html.parser') | |
elements = soup.find_all(class_="MuiTypography-root MuiTypography-subtitle2 css-ydl03f") | |
file = open("IA.txt", "w", encoding="utf-8") | |
for element in elements: |
This file contains 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 os | |
import subprocess | |
import sys | |
cwd = os.getcwd() | |
files = os.listdir(cwd) | |
for file in files: | |
extension = os.path.splitext(file)[1] |