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 | |
# | |
# Copyright (c) 2024 Shen Zhou Hong | |
# This code is released under the MIT License. https://mit-license.org/ | |
# | |
# This Bash script checks if the line defined in $include_line is present | |
# in the Nginx configuration file at $nginx_config_file. If the line is not | |
# found, it appends the line before the last closing bracket and tests the | |
# configuration using 'nginx -t'. If the test succeeds, it reloads Nginx with | |
# 'systemctl reload nginx'. |
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
#!/usr/bin/env bash | |
# | |
# This bash script contains the minimal proceedure required to install a base R | |
# environment on Ubuntu 22.04. It is used as a part of the Vagrantfile | |
# provisioning process for a brand-new, Ubuntu 22.04 virtual machine. This | |
# script may also be ran as a part of a standalone process to download R on any | |
# Ubuntu or Debian operating system. | |
set -o errexit # abort on nonzero exitstatus | |
set -o nounset # abort on unbound variable |
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 numpy as np | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
def pairplot( | |
df: pd.DataFrame, | |
target: pd.Series, | |
names : Union[None, list[str]] = None, | |
size : Union[None, tuple[int, int]] = None, | |
cmap : mpl.colors.LinearSegmentedColormap = plt.cm.coolwarm, |
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 | |
# set the exit status to non-zero (failure) if any commands fail | |
set -e | |
# set the exit status to non-zero (failure) if any variable is referenced before being set | |
set -u | |
# set the shell to be more strict | |
set -o pipefail | |
function show_usage { |
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 # To handle directory paths in a platform independent way | |
import requests.exceptions # To handle exceptions on download | |
import xml.etree.ElementTree as ET # To get additional information from request error | |
column_to_view: dict[str, str] = { | |
"cfu_xrayupload" : "antpr", # Anterio-posterior | |
"cfu_xrayuploadlat": "later", # Lateral-medial | |
"cfu_xrayuploadobl": "obliq", # Oblique | |
"cfu_xrayuploadaxi": "axial" # Axial | |
} |
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 xml.etree.ElementTree as ET | |
class Text: | |
""" | |
Object representation of a Ancient Greek text formatted in the Perseids XML schema. | |
See GAGDT (Guidelines for the Ancient Greek Dependecy Treebank) 2.0 for schema | |
information and additional metadata. | |
""" | |
def __init__(self, path: str) -> None: | |
self.path: str = path |