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
#!/bin/bash | |
# Script to download and install Apple fonts on Ubuntu | |
# Inspired by the PKGBUILD script for Arch Linux | |
# Install wget p7zip-full fontconfig before running the script | |
set -e | |
# Create temporary directories | |
TEMP_DIR=$(mktemp -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
"""Module for renaming MP4 and SRT files based on names read from a text file.""" | |
import os | |
import re | |
from pathlib import Path | |
# Read names from the text file | |
with Path("names.txt").open("r") as f: | |
names = [line.strip() for line in f] |
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
const axios = require('axios'); | |
const xml2js = require('xml2js'); | |
const { promisify } = require('util'); | |
const parseXml = promisify(xml2js.parseString); | |
async function checkUrl(url) { | |
try { | |
const response = await axios.head(url, { timeout: 5000 }); | |
return { url, status: response.status }; |
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 change_background --argument mode_setting | |
# https://arslan.io/2021/02/15/automatic-dark-mode-for-terminal-applications/ | |
# change background to the given mode. If mode is missing, | |
# we try to deduct it from the system settings. | |
set -l mode "light" # default value | |
if test -z $mode_setting | |
set -l val (defaults read -g AppleInterfaceStyle) >/dev/null | |
if test $status -eq 0 | |
set mode "dark" |
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
rg --files -g "*.java" | xargs -P 8 google-java-format -i -a |
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
cat composer.json | jq -r '.require | keys[]' |
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
find . -name "*.java" | xargs google-java-format -i |