Skip to content

Instantly share code, notes, and snippets.

View WarFox's full-sized avatar
🦊
⭐️ ⭐️ ⭐️ ⭐️ ⭐️

Deepu Mohan Puthrote WarFox

🦊
⭐️ ⭐️ ⭐️ ⭐️ ⭐️
View GitHub Profile
@WarFox
WarFox / AGENTS.md
Last active April 2, 2026 13:22
Main Agent / SubAgent workflow

Main Agent / Subagent Workflow

Use this workflow only when work can be split into independent phases with clear file scope, explicit interface or data contracts, and low coupling. Otherwise keep the work local.

  1. Plan (Main): Break the task into phases only when each phase has a clear goal, strict file scope, explicit contract, and validation criteria.
  2. Handoff (Main): For each phase, define allowed files, forbidden files, required skeletons/interfaces/stubs/contracts, and acceptance checks.
  3. Execute (Subagent): Implement only the assigned phase within the given scope and contract, then return a clean diff, summary, and validation status.
  4. Review (Main): Check for correctness, contract drift, scope violations, unnecessary complexity, and style consistency. If valid, simplify and integrate.
  5. Re-plan (Main): If the handoff is insufficient or a blocker is architectural, stop and re-plan. Do not allow workaround architecture.
  6. Finalize (Main): Preserve durable highlevel decisions in project documen
@WarFox
WarFox / README.md
Last active March 30, 2025 20:20
Images

Images

Collection of images used in my project README files.

@WarFox
WarFox / buckets_and_tags.fish
Last active November 8, 2023 14:33
List empty S3 buckets
counter=count
count=0
for b in $(aws s3 ls | cut -d" " -f3)
do
(($counter++))
echo -n $count,"$b",
tags="$(aws s3api get-bucket-tagging --bucket $b --query 'TagSet[*].Value' | jq -r '@csv')"
echo $tags
done
@WarFox
WarFox / github-metrics.svg
Last active June 2, 2025 06:30
lowlighter/metrics/warfox
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@WarFox
WarFox / install-and-setup-openblas-and-lapack.sh
Created August 15, 2022 13:06
Installing lapack and openblas for building scipy on MacOS
#!/usr/env bash
brew install openblas
brew install lapack
# Set the following environment variables so that the build tools can find the libraries.
# openblas
export LDFLAGS="-L/usr/local/opt/openblas/lib $LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/openblas/include $CPPFLAGS"
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig $PKG_CONFIG_PATH"
@WarFox
WarFox / read-jar.sh
Last active November 8, 2023 14:28
Read contents of a jar
# Show contents of MANIFEST.MF in a jar
unzip -q -c target/{name}.jar META-INF/MANIFEST.MF
# List files in a jar
jar -tf target/{name}.jar
@WarFox
WarFox / replace-section-in-file.bash
Last active January 26, 2022 12:19
Replace section in a file
#!/usr/bin/env bash
file_with_anchor_text=$1
file_with_new_content=$2
BEGIN_TEXT='<!-- BEGIN anchor text --!>'
END_TEXT='<!-- END anchor text --!>'
function get_line_number() {
local text=$1
@WarFox
WarFox / 1. generate-key-pair.fish
Last active June 5, 2021 17:25
Generate RS256 key pair for asymmetric jwt signing
openssl genrsa -out jwt-private.pem 2048
openssl rsa -in jwt-private.pem -pubout -out jwt-public.pem
@WarFox
WarFox / date-sequence.clj
Created August 19, 2019 23:22
Generate infinite date sequences
(ns warfox.date
(:import [java.time LocalDate]
[java.time.temporal ChronoUnit]))
(defn date-seq
"Returns lazy sequence of dates starting from `start`"
[^LocalDate start]
(lazy-seq
(cons start
(date-seq (.plusDays start 1)))))
@WarFox
WarFox / spark-submit.el
Last active June 5, 2021 17:26
Submit a apache spark job from Emacs. I use this with Spacemacs to run spark jobs locally
;; Change these
(setq project-name "project-name"
main-class-name "canonical.name.of.main.class"
version "0.0.0"
project-root (projectile-project-root)
log4j-configuration (s-lex-format "file://${project-root}/log4j.properties")
config-file (concat project-root "app.conf"))
(defun spark-submit-command(class-name java-options jar-location)
(let ((command (s-lex-format