Skip to content

Instantly share code, notes, and snippets.

private static String inferTypeName(String raw) {
if (raw == null || raw.isBlank()) return CellType.BLANK.name();
if (isBoolean(raw)) return CellType.BOOLEAN.name();
if (isNumeric(raw)) return CellType.NUMERIC.name();
if (isDateLike(raw)) return "DATE"; // Excel stores dates as NUMERIC + date format
return CellType.STRING.name();
}
private static boolean isBoolean(String s) {
return "true".equalsIgnoreCase(s) || "false".equalsIgnoreCase(s);
#Requires -Version 5.1
<#
Flattens a Maven multi-module Spring Boot project into a single module structure.
Namespace-safe: avoids invalid POM XML node access by using local-name() XPath.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $false)]
[string]$ProjectPath = (Get-Location).Path,
#Requires -Version 5.1
<#
.SYNOPSIS
Flattens a Maven multi-module Spring Boot project into a single module structure.
.DESCRIPTION
This script safely converts a Maven multi-module project into a single module by:
- Creating backups
- Merging source code from all submodules
- Consolidating dependencies from all POMs
@osirison
osirison / tmpmkowqr.tmp
Created April 14, 2025 15:57
Gist created from clipboard
function Remove-GitBranch {
param (
[Parameter(Mandatory = $true)]
[string]$BranchName,
[Parameter(Mandatory = $false)]
[string]$RepoPath = (Get-Location).Path,
[Parameter(Mandatory = $false)]
[switch]$Force
@osirison
osirison / tmphlgzvx.tmp
Created April 14, 2025 10:39
Gist created from clipboard
function Update-GitRepositoriesInParallel {
param (
[Parameter(Mandatory = $false)]
[string]$RootPath = (Get-Location).Path,
[Parameter(Mandatory = $false)]
[int]$MaxThreads = 8,
[Parameter(Mandatory = $false)]
[switch]$FetchOnly
@osirison
osirison / tmplhbr5u.tmp
Created April 1, 2025 14:10
Gist created from clipboard
function Get-DockerStatus {
[CmdletBinding()]
param()
# Check if Docker is running
try {
$null = docker info 2>&1
}
catch {
Write-Host "🔴 Docker service is not running!" -ForegroundColor Red
@osirison
osirison / .gitconfig
Last active February 27, 2025 15:29
useful git aliases
[alias]
# Interactive rebase with the given number of latest commits
reb = "!r() { git rebase -i HEAD~$1; }; r"
# Find commits by commit message
find = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
# List contributors with number of commits
contributors = shortlog --summary --numbered