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 os | |
| import eyed3 | |
| for artist in []: | |
| print(artist) | |
| for album in filter(lambda x: not x.startswith("."), os.listdir(f"./{artist}")): | |
| print(f"{artist}/{album}") | |
| for song in filter(lambda x: x.endswith('mp3'), os.listdir(f"./{artist}/{album}/")): | |
| try: |
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
| from pymediainfo import MediaInfo | |
| import os | |
| def get_absolute_paths(root_dir): | |
| for dirpath, _, filenames in os.walk(root_dir): | |
| for f in filenames: | |
| yield os.path.abspath(os.path.join(dirpath, f)) | |
| def get_relevant_file_paths(root_dir): | |
| file_paths = get_absolute_paths(root_dir) |
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
| repos: | |
| - repo: https://github.com/Quantco/pre-commit-mirrors-flake8 | |
| rev: '' # Use the sha / tag you want to point at | |
| hooks: | |
| - id: flake8-conda | |
| - repo: https://github.com/Quantco/pre-commit-mirrors-black | |
| rev: '' # Use the sha / tag you want to point at | |
| hooks: | |
| - id: black-conda | |
| - repo: local |
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/python3 | |
| import subprocess | |
| from tabulate import tabulate | |
| out = subprocess.Popen(['docker','ps', '--format', '"table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.RunningFor}}\t{{.Ports}}"'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
| stdout, _ = out.communicate() | |
| stdout = stdout.decode('utf-8') | |
| lines = stdout.split('\n') | |
| table = [] |
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 setSlackStatusFromCalendar() { | |
| var calendarId = PropertiesService.getScriptProperties().getProperty('CALENDAR_ID'); | |
| var calendar = CalendarApp.getCalendarById(calendarId); | |
| var now = new Date(); | |
| var twoHoursFromNow = new Date(now.getTime() + (2 * 60 * 60 * 1000)); | |
| var events = calendar.getEvents(now, twoHoursFromNow); | |
| if (events.length === 0){ | |
| setSlackStatus('free'); | |
| } else { | |
| var away = false; |
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 requests | |
| import json | |
| SLACK_WEBHOOK = "<YOUR_SLACK_WEBHOOK>" | |
| API = "https://www.galaxus.ch/api/v1/products/salesoffers?culture=de-ch" | |
| PRODUCT_IDS = [12949433] # List of product ids to check | |
| results = requests.post(API, json=PRODUCT_IDS).json() | |
| for sales_offer_product in results['salesOffers']: | |
| product_id = sales_offer_product['productId'] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.