Skip to content

Instantly share code, notes, and snippets.

View antonioshadji's full-sized avatar

Antonios Hadjigeorgalis antonioshadji

View GitHub Profile
@antonioshadji
antonioshadji / .cursorrules
Created June 1, 2025 01:00 — forked from boxabirds/.cursorrules
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors
@antonioshadji
antonioshadji / default_argument.py
Last active May 26, 2025 15:33
test of python default argument definition and the results
def func(x=[]):
x.append(1)
return x
print(func())
print(func())
print(func([2]))
@antonioshadji
antonioshadji / postman-signed-headers.js
Last active August 30, 2024 21:22
Postman pre-request code that works with localhost server to include signed header in request
// This script reqires a local server to be running at localhost:3000
// to handle the cryptographic signature.
// store your signing key in your enviroment
const signingKey = pm.environment.get("signing_key");
// javascript Date.now() returns unix timestamp in ms, convert to s
const timestamp = Math.floor(Date.now() / 1000)
const method = pm.request.method.toString();
// Postman does not substitute URL parameters before running this script
@antonioshadji
antonioshadji / postmanCdn.js
Created August 29, 2024 13:04
Example of loading library from CDN in postman.
// The example at https://blog.postman.com/adding-external-libraries-in-postman/
// was failing for me due to exports, for this particular library stripping the last 3 lines loaded the library successfully.
// NOTE: this particular library does not work in Postman due to missing dependencies from node/browser
function removeLastLines(text, num) {
// Split the text into lines
const lines = text.split('\n');
// Remove the last two lines
lines.splice(-num);
@antonioshadji
antonioshadji / draw.io.py
Created July 27, 2024 20:13
Generate evenly spaced connection points for rectangular draw.io diagram shapes
""" Place the resulting output into the style of a draw.io shape.
Edit Style -> paste output at end.
"""
import numpy as np
# generate connection points for draw.io shapes
hnum=16 # sections along the horizontal
vnum=4 # sections along the vertical
precision=4
points=[]
@antonioshadji
antonioshadji / tax_calc.py
Created May 1, 2024 21:26
Calculate income tax on taxable income
# tiers are for married filing jointly 2024
over = [
0,
23200,
94300,
201050,
383900,
487450,
731200
]
@antonioshadji
antonioshadji / Dockerfile.user
Created March 23, 2023 13:25
Dockerfile create and use non-root user inside container
ARG UNAME=antonios
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID -o $UNAME
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
RUN usermod -aG sudo $UNAME
USER $UNAME
@antonioshadji
antonioshadji / kyc.mermaid
Created July 26, 2022 17:54
Mermaid code for KYC sequence Diagram
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am antonioshadji on github.
  • I am antonioshadji (https://keybase.io/antonioshadji) on keybase.
  • I have a public key ASAqQHrfa898wvvQfSnZggzRQzIwBT4d_4QA6CdB_MBHcAo

To claim this, I am signing this object:

@antonioshadji
antonioshadji / main.c
Created April 11, 2019 00:18
test c program for testing python subprocess
#define _POSIX_C_SOURCE 199309L
#include <stdio.h>
#include <time.h>
int main(int argc,char* argv[])
{
time_t now;
time(&now);
printf("Today is: %s", ctime(&now));