Skip to content

Instantly share code, notes, and snippets.

View sualeh's full-sized avatar
⚠️
404 Not Found

Sualeh Fatehi sualeh

⚠️
404 Not Found
View GitHub Profile
@sualeh
sualeh / create_and_download_spreadsheet.ipynb
Last active July 31, 2024 22:09
create_and_download_spreadsheet.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sualeh
sualeh / extract_and_rename.ps1
Last active June 30, 2024 12:37
Extracts raw text from Amazon TextTract zip files
Add-Type -Assembly System.IO.Compression.FileSystem
# Define the path to your ZIP files
$ZipFilesPath = "."
# Create a temporary folder for extraction
$TempPath = "."
# Extract files from ZIPs and rename them
$Shell = New-Object -com Shell.Application
@sualeh
sualeh / python_class.ipynb
Last active June 25, 2024 03:03
python_class.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sualeh
sualeh / Main.java
Created September 27, 2023 22:19 — forked from Whatshiywl/Main.java
SchemaCrawler API serialize
package foo.bar;
import java.nio.file.Paths;
import java.util.logging.Level;
import schemacrawler.schemacrawler.LimitOptionsBuilder;
import schemacrawler.schemacrawler.LoadOptionsBuilder;
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder;
import schemacrawler.schemacrawler.SchemaInfoLevelBuilder;
@sualeh
sualeh / SchemaCrawlerDiagramGenerator.java
Created May 3, 2023 20:06
Generate Schema Diagrams with SchemaCrawler
package de.dpma.azubi.markenschema.schemacrawler;
import static us.fatehi.utility.Utility.isBlank;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@sualeh
sualeh / ApiExampleAthena.java
Created April 22, 2023 12:48
SchemaCrawler example code for AWS Athena
package com.example;
import java.sql.Connection;
import java.util.logging.Level;
import schemacrawler.crawl.ConnectionInfoBuilder;
import schemacrawler.schema.Catalog;
import schemacrawler.schema.Column;
import schemacrawler.schema.Schema;
import schemacrawler.schema.Table;
import schemacrawler.schemacrawler.LimitOptionsBuilder;
@sualeh
sualeh / README.md
Last active February 24, 2025 11:09
Create Nice-looking Schema Diagrams in PlantUML

Create Nice-looking Schema Diagrams in PlantUML

PlantUML is a descriptive language to generate a number of types of software diagrams, such as sequence, class, deployment and state diagrams, and many others. PlantUML does not generate very good-looking schema diagrams out of the box, but it supports themes and preprocessed macros. If you use themes and macros, you can not only use a simplified syntax, but also generate beautiful diagrams.

Here is an example of a PlantUML schema diagram, and we will build up the code to generate it.

Schema diagram

To start, describe your schemas, tables and columns using this syntax as an example.

"""Test for lab module."""
from unittest import TestCase
from schedule import Schedule
from unittest import skip
class TestLab3ForGrading(TestCase):
"""Test for Lab 3."""
def test_schedule_happy_path(self):
@sualeh
sualeh / test_lab3_for_grading.py
Created September 19, 2022 18:02
COMP-880 Lab 3 Grading Tests
"""Tests for lab module."""
import pytest
import schedule
def test_schedule_0():
"""Tests an argument of None, and ensures that no error occurs."""
sch = schedule.Schedule(None, ['Math'])
classes: list = sch.classes_for('Mon')
for day in ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']:
@sualeh
sualeh / test_lab1_for_grading.py
Last active September 19, 2022 18:01
COMP-880 Lab 1 Grading Tests
"""Tests for lab1 module."""
import pytest
import lab1
def test_minimum_0():
"""Tests an argument of None, and ensures that no error occurs."""
data = None
assert lab1.minimum(data) is None