Skip to content

Instantly share code, notes, and snippets.

View alaa-alawi's full-sized avatar

Ala'a Alawi alaa-alawi

  • UAE
  • 09:50 (UTC +04:00)
View GitHub Profile
@alaa-alawi
alaa-alawi / mcp.py
Created October 15, 2026 17:57
GUI Tools MCP server example
#!/usr/bin/env python3
"""Five local Tk dialogs exposed as MCP tools (Python 3.10+).
Install (Linux Mint / Ubuntu):
sudo apt install python3-tk
python3 -m venv --system-site-packages .venv
.venv/bin/pip install 'mcp>=1.12,<2' pillow tkintermapview
Run: .venv/bin/python mcp.py --port 8765
Default: Streamable HTTP at http://127.0.0.1:8000/mcp
(defun make-upload-filename ()
(etypecase *upload-filename-generator*
;; the old behaviour.
(null t)
;; the new behaviour.
((or symbol function)
(lambda (&rest args)
(let ((filename (apply *upload-filename-generator* args)))
(when *file-upload-hook*
(funcall *file-upload-hook* filename))
@alaa-alawi
alaa-alawi / util.lisp.orig
Created May 21, 2012 16:07
implementation comparision
;; original implementation
;; hunchentoot;utils.lisp
;;
(let ((counter 0))
(declare (ignorable counter))
(defun make-tmp-file-name (&optional (prefix "hunchentoot"))
"Generates a unique name for a temporary file. This function is
called from the RFC2388 library when a file is uploaded."
(let ((tmp-file-name
#+:allegro