Skip to content

Instantly share code, notes, and snippets.

@dbatis
dbatis / clean-artifacts.fish
Created April 19, 2026 13:55
Script to clean build artifacts in sub-folders
#!/usr/bin/env fish
# Search immediate sub-directories and clean build artifacts.
#
# Usage:
# $ clean-artifacts.fish [DIRECTORY]
#
# The script will search for the build file and run the approriate command.
# It does not search all sub-directories recursively, only the immediate
# children.
@dbatis
dbatis / extract_maven_interdependencies.py
Last active December 13, 2015 21:22
This command-line utility receives a directory containing a multi-module Maven project and will output a graph displaying the inter-dependencies of modules.
"""
This command-line utility receives a directory containing a multi-module Maven project and will output a graph
displaying the inter-dependencies of modules.
The input directory need not be an actual Maven aggregator POM or anything of the sort. All pom.xml will be
parsed that reside inside the given directory structure.
The output format is determined by the file extension. The following extensions are supported:
- .graphml
- .gml
__author__ = 'dbatis'
def hardyRamanujan(upperLimit):
"""
Computes all cases of x^3 + y^3 = z^3 + g^3, where x <> y <> z <> g and x, y, z, g < upperLimit.
Example output:
>>> hardyRamanujan(20)
[[(1, 12, 1729), (9, 10, 1729)], [(2, 16, 4104), (9, 15, 4104)]]