Skip to content

Instantly share code, notes, and snippets.

View markheramis's full-sized avatar
💭
I may be slow to respond. Busy

Mark Clu Heramis markheramis

💭
I may be slow to respond. Busy
  • Wend Corporation
  • Philippines
View GitHub Profile

find-large-files.ps1

PowerShell port of the original Bash large-files finder. Recursively scans a directory (and its subdirectories), prunes ignored paths exactly like the Bash version (including .gitignore + command-line --ignore patterns + .git), then lists the top N largest files with human-readable sizes (B / KB / MB / GB). Identical behavior to the Bash script you provided:

  • Same argument parsing
  • Same .gitignore parsing rules (skip empty lines/comments, trim, remove trailing /)
  • Same prune semantics (-name for wildcards, -path "*/pat" + -path "*/pat/*" for directories)
  • Same output formatting and column alignment
  • Same silent error handling (2>/dev/null-ErrorAction SilentlyContinue)

@markheramis
markheramis / README.md
Created April 10, 2026 02:02
Search for Large Files

Large File Search (large-file-search.sh)

A robust, dependency-free bash script that recursively searches a directory to find the largest files. It is designed to be safe with complex file names (like those containing spaces) and automatically respects your project's .gitignore rules.

Features

  • Automatic .gitignore Parsing: Automatically detects and ignores files/directories listed in a .gitignore file located in the target directory.
  • Custom Ignore Flags: Pass specific directories or patterns to ignore on the fly using --ignore.
  • Space-Safe: Uses dynamic bash arrays and tab-delimiters to ensure files and directories with spaces in their names do not break the script.
  • Human-Readable Output: Converts byte counts into highly readable formats (B, KB, MB, GB).
  • Absolute Paths: Automatically resolves and displays the absolute path of the files for easy locating.
@markheramis
markheramis / DICOMweb-Collection.json
Last active October 23, 2025 12:00
DICOMweb Postman Collection
{
"info": {
"name": "DICOMweb API Collection",
"description": "Postman collection for DICOMweb APIs: QIDO-RS, STOW-RS, WADO-RS, and UPS-RS.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "QIDO-RS",
"item": [
@markheramis
markheramis / README.md
Created November 14, 2024 03:26
This project is a demonstration of how to cleanly validate function parameters in typescript without 3rd party dependencies.

Clean Parameter Validation in TypeScript

This project demonstrates a clean, reusable approach to validating function parameters in TypeScript. It includes a sample UserData interface, a validateUserData function for runtime validation, and a createUser function that uses the validated parameters.

Purpose

This code snippet showcases how to enforce strict validation of function parameters in TypeScript by:

Defining an interface to outline the expected structure. Using a separate validation function to check the parameter's conformance before it’s passed to the main function.

@markheramis
markheramis / Change.java
Last active November 2, 2024 10:14
Change Calculator
import java.util.Scanner;
/**
*
* @author Mark
*/
public class Change {
private final double tax = 0.06;
private double cost;
@markheramis
markheramis / README.md
Last active September 27, 2024 20:06
Ghost Routes for Testing

Temporary API Testing in Laravel

This section describes the setup and testing of a temporary API route within a PHPUnit test case in a Laravel application.

Overview

The provided snippet demonstrates how to dynamically add a route within the setUp method of a PHPUnit test case and test the API response.

Code Description

  • setUp Method:
  • The setUp method is overridden to set up the test environment.
@markheramis
markheramis / main.rs
Last active August 15, 2024 16:50
MySQL table dependency resolution
use std::collections::{HashMap, VecDeque};
use std::io;
#[tokio::main]
async fn main() -> io::Result<()> {
// Initialize a HashMap to represent the tables and their dependencies
let mut tables = HashMap::new();
tables.insert("users".to_string(), vec![]);
tables.insert("roles".to_string(), vec![]);
@markheramis
markheramis / concat_columns.sql
Created May 21, 2024 19:55
Concat Table Columns into one column in the result.
SELECT
GROUP_CONCAT(`COLUMN_NAME` SEPARATOR ',') AS `columns`
FROM `INFORMATION_SCHEMA`.`COLUMNS`
WHERE
`TABLE_SCHEMA` = '<DATABASE>' AND
`TABLE_NAME` = '<TABLE>'
@markheramis
markheramis / dir_scan.py
Last active May 7, 2020 07:57
Check directory content size (1 level only for files and directory)
#!/usr/bin/python
import sys, os, subprocess, math
args = sys.argv[1:]
#print 'Number of arguments:', len(args), 'arguments.'
#print 'Argument List:', str(args)
def get_size(start_path = '.'):
total_size = 0
import java.applet.*;
import java.awt.*;
import java.awt.GridLayout;
import java.awt.event.*;
public class kwaza extends Applet implements ActionListener {
int tuifee;
String username = "IllusiveMan";
String password = "1234567890";
Label intro = new Label("WELCOME TO ENROLLMENT SYSTEM");